closes #995
This commit is contained in:
Thibault Cohen
2016-04-17 22:08:56 -04:00
committed by Cameron Sparr
parent d638f6e411
commit 75a9845d20
2 changed files with 9 additions and 6 deletions

View File

@@ -398,15 +398,16 @@ func (s *Snmp) Gather(acc telegraf.Accumulator) error {
// only if len(s.OidInstanceMapping) == 0
if len(OidInstanceMapping) >= 0 {
if err := host.SNMPMap(acc, s.nameToOid, s.subTableMap); err != nil {
return err
log.Printf("SNMP Mapping error for host '%s': %s", host.Address, err)
continue
}
}
// Launch Get requests
if err := host.SNMPGet(acc, s.initNode); err != nil {
return err
log.Printf("SNMP Error for host '%s': %s", host.Address, err)
}
if err := host.SNMPBulk(acc, s.initNode); err != nil {
return err
log.Printf("SNMP Error for host '%s': %s", host.Address, err)
}
}
return nil