Example: Sending Test Traps
From the command line, enter the following command:
$ snmptrap -v 2c -c public localhost '' 126.96.36.199.4.1.2021.9188.8.131.52.184.108.40.206.6 s \ "Device in Austin"
- Save this demonstration MIB into a file.
- Send the trap.
- Open the Event Console and find the trap you sent.
- Send this event to the event archive.
Load some MIBs into the system so that this OID is translated into a better
Copy the demonstration MIB into $ZENHOME/share/mibs/site.
Run zenmib to load it:
$ zenmib run -v 10 DEBUG:zen.zenmib:TRAP-TEST-MIB.mib INFO:zen.zenmib:Unable to find a file \ providing the MIB UCD-SNMP- MIB ...
The MIB loaded, but is missing some other definitions. Copy them:
$ cp /usr/share/snmp/mibs/SNMPv2-MIB.txt $ZENHOME/share/mibs/site \ $ cp /usr/share/snmp/mibs/UCD-SNMP-MIB.txt $ZENHOME/share/mibs/site
Run zenmib again and load the definitions into the system:
$ zenmib run -v 10
Restart the zentrap daemon to retrieve the new MIB
$ zentrap restart
Send the trap a second time:
$ snmptrap -v 2c -c public localhost '' 220.127.116.11.4.1.2021.13.991 .18.104.22.168.22.214.171.124 s \ "Device in Austin"
Check the event. Make sure the count is 1. If the count is 2, send the event to the
event archive and send the trap again. Look at the Details tab. Now you should see
something like this:
sysLocation Device in Austin
You should also see that the event summary changes from:
snmp trap 126.96.36.199.4.1.2021.13.991 from localhost
snmp trap ucdExperimental from localhost
- Copy the demonstration MIB into $ZENHOME/share/mibs/site.