Send a notification trap SNMP with snmptrap command Linux

Nicolas Frbezar picture Nicolas Frbezar · May 9, 2016 · Viewed 28k times · Source

For test purpose, i'm trying to use the snmptrap command to produce a .1.3.6.1.2.1.43.18.2.0.1 trap (printer alert trap).

I'm not in my two feet with the syntax of the snmptrap command, so can someone explain me how to correctly use this command, specially for this trap if it's possible ?

Answer

Andrew Komiagin picture Andrew Komiagin · May 10, 2016

The syntax is pretty simple:

snmptrap -c public -v 2c 127.0.0.1 "" 1.3.6.1.2.1.43.18.2.0.1

The problem here is that this particular trap should be sent with 6 varbinds:

  • prtAlertIndex
  • prtAlertSeverityLevel
  • prtAlertGroup
  • prtAlertGroupIndex
  • prtAlertLocation
  • prtAlertCode

Thus you'll also have to provide values for all these varbinds. So the Trap Receiver will be able to handle this type of trap properly.

I'd suggest using tools like NetDecision Trap Simulator which automatically configures traps to send based on MIB definitions.

enter image description here