To generate test traps using the "sm_snmp" command line tool to include multiple varbinds to test incoming trap definitions.
Smarts 10.1.x
TCSA 2.x
To use sm_snmp to generate traps with multiple varbinds using the following example:
Timestamp: 22-Sep-2004 05:05:05 ED
Agent: #.#.#.#
Enterprise OID: .1.3.6.1.4.1.546.1.1
Generic Type: 6
Specific Type: 7
Varbinds: [oid]->[varbind]
.1.3.6.1.4.1.546.5.6.4.1.2.<value> --> 1
.1.3.6.1.4.1.546.5.6.4.1.5.<value> --> 2
.1.3.6.1.4.1.546.5.6.4.1.3.<value> --> 1129450700
.1.3.6.1.4.1.546.5.6.4.1.7.<value> --> TestName
.1.3.6.1.4.1.546.5.6.4.1.9.<value> --> This is a test alarm
.1.3.6.1.4.1.546.5.6.4.1.12.<value> --> Event Log - Application Warning
.1.3.6.1.4.1.546.5.6.4.1.1.<value> --> <value>
.1.3.6.1.4.1.546.5.6.4.1.14.<value> --> 8
The <value> above would be an index number that's included in the trap send from the device.
For the example, we assume the value is 151001
./sm_snmp -d <trap receiver> -p <SNMP port> trap <agent IP address> <enterprise oid> <generic type> <specific type> 0 <varbind 1> <type> <varbind1 value>
./sm_snmp -d <trap receiver> -p <SNMP port> trap 111.222.333.444 .1.3.6.1.4.1.546.1.1 6 7 0 .1.3.6.1.4.1.546.5.6.4.1.2.151001 i 1 .1.3.6.1.4.1.546.5.6.4.1.5.151001 i 2 .1.3.6.1.4.1.546.5.6.4.1.3.151001 i 1129450700 .1.3.6.1.4.1.546.5.6.4.1.7.151001 s "TestName" .1.3.6.1.4.1.546.5.6.4.1.9.151001 s "This is a test alarm" .1.3.6.1.4.1.546.5.6.4.1.12.151001 s "Event Log - Application Warning" .1.3.6.1.4.1.546.5.6.4.1.1.151001 i 151001 .1.3.6.1.4.1.546.5.6.4.1.14.151001 i 8
When you expand the varbind like the above example, the "i" in
.1.3.6.1.4.1.546.5.6.4.1.2.151001 i 1
Indicates this value is an integer. While the "s" indicates this value is a string
.1.3.6.1.4.1.546.5.6.4.1.7.151001 s "TestName"
The string value is enclosed by double quotation marks