This commit is contained in:
crusader 2018-09-18 01:30:17 +09:00
parent 419c5cb6ac
commit e8cff368de
2 changed files with 16 additions and 3 deletions

View File

@ -8,7 +8,7 @@ import (
) )
func PingHost(_host *omd.Host, pingOption ounp.Option) (ounp.Result, error) { func PingHost(_host *omd.Host, pingOption ounp.Option) (ounp.Result, error) {
return host.Ping(host, pingOption) return host.Ping(_host, pingOption)
} }
func PingService(_service *omd.Service, pingOption *ounp.PingOption) (ounp.Result, error) { func PingService(_service *omd.Service, pingOption *ounp.PingOption) (ounp.Result, error) {

View File

@ -1,6 +1,7 @@
package service package service
import ( import (
"log"
"reflect" "reflect"
oa "git.loafle.net/overflow/annotation-go" oa "git.loafle.net/overflow/annotation-go"
@ -32,11 +33,23 @@ func (s *PingService) DestroyService() {
} }
func (s *PingService) PingHost(host *omd.Host, pingOption *ounp.PingOption) (*ounp.PingResult, error) { func (s *PingService) PingHost(host *omd.Host, pingOption *ounp.PingOption) (*ounp.PingResult, error) {
return ping.PingHost(host, pingOption) result, err := ping.PingHost(host, pingOption)
if nil != err {
log.Print(err)
return nil, err
}
return result.(*ounp.PingResult), nil
} }
func (s *PingService) PingService(service *omd.Service, pingOption *ounp.PingOption) (*ounp.PingResult, error) { func (s *PingService) PingService(service *omd.Service, pingOption *ounp.PingOption) (*ounp.PingResult, error) {
return ping.PingService(service, pingOption) result, err := ping.PingService(service, pingOption)
if nil != err {
log.Print(err)
return nil, err
}
return result.(*ounp.PingResult), nil
} }
func (s *PingService) PingAll() error { func (s *PingService) PingAll() error {