func (e Check) Fetch() []common.MapStr { check := check.NagiosCheck{} check.Setup(Config) events, err := check.Check() if err != nil { logp.Err("Error On Command: %q: %v", Config.Name, err) } return events }
func (nagiosCheckBeat *NagiosCheckBeat) Run(b *beat.Beat) error { for _, checkConfig := range nagiosCheckBeat.checks { checkInstance := check.NagiosCheck{} checkInstance.Setup(&checkConfig) go checkInstance.Run(func(events []common.MapStr) { b.Events.PublishEvents(events) }) } for { select { case <-nagiosCheckBeat.done: return nil } } return nil }