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 '' 184.108.40.206.4.1.2021.991 .220.127.116.11.18.104.22.168 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 '' 22.214.171.124.4.1.2021.13.991 .126.96.36.199.188.8.131.52 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 184.108.40.206.4.1.2021.13.991 from localhost
snmp trap ucdExperimental from localhost