added processing err
This commit is contained in:
parent
fa53ca1724
commit
4d4b9b6fa6
@ -37,7 +37,6 @@ func (c *CrawlerImpl) Init(data []byte) ([]byte, error) {
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// load all file in path
|
// load all file in path
|
||||||
return json.Marshal(true)
|
return json.Marshal(true)
|
||||||
}
|
}
|
||||||
@ -55,7 +54,6 @@ func (c *CrawlerImpl) Remove(id string) ([]byte, error) {
|
|||||||
return json.Marshal(true)
|
return json.Marshal(true)
|
||||||
}
|
}
|
||||||
func (c *CrawlerImpl) Get(id string) ([]byte, error) {
|
func (c *CrawlerImpl) Get(id string) ([]byte, error) {
|
||||||
|
|
||||||
if c.internal != nil {
|
if c.internal != nil {
|
||||||
out, err := c.internal.Internal(c.GetConfig(id))
|
out, err := c.internal.Internal(c.GetConfig(id))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -64,7 +62,7 @@ func (c *CrawlerImpl) Get(id string) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
return nil, errors.New("Not Assign")
|
return nil, errors.New("Not Assigned")
|
||||||
}
|
}
|
||||||
|
|
||||||
// internal methods
|
// internal methods
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"loafle.com/overflow/commons_go/matcher/snmp"
|
"loafle.com/overflow/commons_go/matcher/snmp"
|
||||||
"loafle.com/overflow/crawler_go"
|
"loafle.com/overflow/crawler_go"
|
||||||
config "loafle.com/overflow/agent_api/config_manager"
|
config "loafle.com/overflow/agent_api/config_manager"
|
||||||
|
"log"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SNMPV2CHeahthCrawler struct {
|
type SNMPV2CHeahthCrawler struct {
|
||||||
@ -12,7 +13,7 @@ type SNMPV2CHeahthCrawler struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *SNMPV2CHeahthCrawler)Internal(params config.Config) ([]byte, error) {
|
func (r *SNMPV2CHeahthCrawler)Internal(params config.Config) ([]byte, error) {
|
||||||
|
log.Println("????????????????????????????????")
|
||||||
b, err := r.CheckHeahth(params)
|
b, err := r.CheckHeahth(params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -55,7 +55,6 @@ func (s *SocketHeahthCrawler) getConnection(params config.Config) (net.Conn, err
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *SocketHeahthCrawler) CheckHeahth(params config.Config) (bool, error) {
|
func (s *SocketHeahthCrawler) CheckHeahth(params config.Config) (bool, error) {
|
||||||
|
|
||||||
conn, err := s.getConnection(params)
|
conn, err := s.getConnection(params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user