Shortening the MIB: snmptrap -v 3 -e 0x090807060504030201 -u the_user_name -a SHA -A the_SHA_string -x AES -X the_AES_string -l authPriv localhost '' netSnmpExampleHeartbeatNotification netSnmpExampleHeartbeatRate i 123456 Using a MIB: snmptrap -v 3 -e 0x090807060504030201 -u the_user_name -a SHA -A the_SHA_string -x AES -X the_AES_string -l authPriv localhost '' NET-SNMP-EXAMPLES-MIB::netSnmpExampleHeartbeatNotification netSnmpExampleHeartbeatRate i 123456 The command below takes the form of: snmptrap -v -e -u -a -A -x -X -l authPriv Traphandle default /usr/sbin/snmptthandler The commands above required the following settings in /etc/snmp/nf disableAuthorization yes Shortening the MIB: snmptrap -v 2c -c public localhost '' netSnmpExampleHeartbeatNotification netSnmpExampleHeartbeatRate i 123456 Using a MIB: snmptrap -v 2c -c public localhost '' NET-SNMP-EXAMPLES-MIB::netSnmpExampleHeartbeatNotification netSnmpExampleHeartbeatRate i 123456 The command below takes the form of: snmptrap -v -c The key point to this section is that you now know why the commands below have two single quotes '' for the uptime value. This equates to 36 days, 2 hours, 40 minutes and 51.67 seconds. Here is an example: DISMAN-EVENT-MIB::sysUpTimeInstance 36:2:40:51.67 So what value should you type in the commands below? Oddly enough, simply supplying no value by using two single quotes '' will instruct the command to obtain the value from the operating system you are executing this on.įor those who dig deeper and look at the spooled trap before it's processed will want to understand what type of format it is.
Sometimes this is the operating system, other devices might use the SNMP engine uptime. Uptime is how long the system has been running since boot. The options are explained in each section below however there is one option that is common and needs explaining, uptime.Įvery trap needs an uptime value. When you send a trap, it must of course conform to a set of standards. You will be executing the command on the Nagios host itself, this is why you see localhost in the commands below. This troubleshooting method will confirm if your Nagios server is correctly receiving SNMP Traps and is configured correctly. Sometimes when troubleshooting an SNMP Trap issue, it can be very helpful to remove the actual device that could be causing problems and use the snmptrap command instead. This article shows you several methods of sending a trap to your Nagios server to test SNMP Trap functionality.