Example: Sending test traps
As root, attach to the zope service.
serviced service attach zope/0
From the command line, enter the following command:
$ snmptrap -v 2c -c public localhost '' 188.8.131.52.4.1.2021.991 .184.108.40.206.220.127.116.11 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 format. As
a pre-requisite to this procedure, refer to the section Using MIB files.
- Copy the demonstration MIB into /opt/serviced/var/volumes/<instance_id>/zenoss-var-ext/uploadedMIBs.
Run the following command:
serviced service run zope zenmib run -v10 /opt/zenoss/var/ext/uploadedMIBs/<MIB_filename> --path=/<device_class> --removemiddlezeros --mibdepsdir=/opt/zenoss/var/ext/uploadedMIBs
The --removemiddlezeros flag is needed when MIBs use notification OIDs with embedded zeros.
Send the trap a second time:
$ snmptrap -v 2c -c public localhost '' 18.104.22.168.4.1.2021.13.991 .22.214.171.124.126.96.36.199 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 188.8.131.52.4.1.2021.13.991 from localhost
snmp trap ucdExperimental from localhost