Search code examples
snmpsnmp-trap

Anything wrong with this trap message?


I am using this Linux command to send snmp v2c traps.

snmptrap -m ./ibmConvergedPowerSystems.mib -v 2c -c public 127.0.0.1 0 IBM-CPS-MIB::problemTrap cpsSystemSendTrap s "This is a test"

I am receiving this.

enter image description here

The way I am reading it is that it's got 3 OIDs.

  1. sysUpTime oid (".1.3.6.1.2.1.1.3.0") - which is 0.

  2. snmpTrapOID (".1.3.6.1.6.3.1.1.4.1.0") - which contains OID for this -> http://www.oidview.com/mibs/2/IBM-CPS-MIB.html

  3. Enterprise specific trap with data (data for IBM-CPS-MIB).

Did I get it right?

Only thing I care about is #3. Is there a way to modify the command to get rid of the other two OIDs. Or v2c trap will always have the first two?


Solution

  • This is pretty normal Enterprise specific SNMP notification. The type of this notification (PDU format) is TRAPv2. This trap contains 3 varbinds. The first two are required by RFC1448. So you cannot get rid of them.

    • The first varbind snmpTrapOID.0 is the actual Object Identifier (OID) that identifies the type of Trap.
    • The second varbind sysUptime.0 is from RFC1213 (MIB-2). Basically it is the time since device was last rebooted.

    I would add .0 to cpsSystemSendTrap as it is a scalar object.