Skip to content

Commit

Permalink
improve the error log message for snmp trap (influxdata#8552)
Browse files Browse the repository at this point in the history
add OID value and source information into error log and make it easier for troubleshooting
  • Loading branch information
xiaopeng163 authored Dec 23, 2020
1 parent 35a2210 commit 2c61fad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/inputs/snmp_trap/snmp_trap.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func makeTrapHandler(s *SnmpTrap) handler {
if trapOid != "" {
e, err := s.lookup(trapOid)
if err != nil {
s.Log.Errorf("Error resolving V1 OID: %v", err)
s.Log.Errorf("Error resolving V1 OID, oid=%s, source=%s: %v", trapOid, tags["source"], err)
return
}
setTrapOid(tags, trapOid, e)
Expand Down Expand Up @@ -322,7 +322,7 @@ func makeTrapHandler(s *SnmpTrap) handler {
var err error
e, err = s.lookup(val)
if nil != err {
s.Log.Errorf("Error resolving value OID: %v", err)
s.Log.Errorf("Error resolving value OID, oid=%s, source=%s: %v", val, tags["source"], err)
return
}

Expand All @@ -340,7 +340,7 @@ func makeTrapHandler(s *SnmpTrap) handler {

e, err := s.lookup(v.Name)
if nil != err {
s.Log.Errorf("Error resolving OID: %v", err)
s.Log.Errorf("Error resolving OID oid=%s, source=%s: %v", v.Name, tags["source"], err)
return
}

Expand Down

0 comments on commit 2c61fad

Please sign in to comment.