Skip to content

Commit

Permalink
Convert snmp_trap_test.go to table test (influxdata#6803)
Browse files Browse the repository at this point in the history
Add a test for v1 generic trap.  Add missing leading period in v1 generic trap oid.
  • Loading branch information
reimda authored and idohalevi committed Sep 23, 2020
1 parent 5156d60 commit 2d6c031
Show file tree
Hide file tree
Showing 2 changed files with 268 additions and 263 deletions.
2 changes: 1 addition & 1 deletion plugins/inputs/snmp_trap/snmp_trap.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func makeTrapHandler(s *SnmpTrap) handler {
var trapOid string

if packet.GenericTrap >= 0 && packet.GenericTrap < 6 {
trapOid = "1.3.6.1.6.3.1.1.5." + strconv.Itoa(packet.GenericTrap+1)
trapOid = ".1.3.6.1.6.3.1.1.5." + strconv.Itoa(packet.GenericTrap+1)
} else if packet.GenericTrap == 6 {
trapOid = packet.Enterprise + ".0." + strconv.Itoa(packet.SpecificTrap)
}
Expand Down
Loading

0 comments on commit 2d6c031

Please sign in to comment.