container_network/crawler/health/netbios/NetBIOSHealthCrawler.go
2018-07-02 20:53:06 +09:00

39 lines
856 B
Go

package netbios
import (
cnsmn "git.loafle.net/commons/service_matcher-go/netbios"
ocmsc "git.loafle.net/overflow/commons-go/model/sensorconfig"
"git.loafle.net/overflow/container_network/crawler/health"
"git.loafle.net/overflow/crawler-go"
)
type NetBIOSHealthCrawler struct {
health.SocketHealthCrawler
}
func (c *NetBIOSHealthCrawler) Key() string {
return "NBSS_HEALTH"
}
func (c *NetBIOSHealthCrawler) String() string {
return "NetBIOS Health Crawler"
}
func (c *NetBIOSHealthCrawler) Auth(auth map[string]interface{}) error {
return nil
}
func (c *NetBIOSHealthCrawler) Get(config *ocmsc.SensorConfig) (map[string]string, error) {
rss, err := c.CheckHealth(config)
if err != nil {
return nil, err
}
return rss, nil
}
func NewCrawler() crawler.Crawler {
c := &NetBIOSHealthCrawler{}
c.SetMatcher(cnsmn.NewMatcher())
return c
}