Generating a SNMP Trap from PingPlotter or MultiPing


Question

Is there any way to generate an SNMP Trap message using the PingPlotter alert system?

Solution

Neither PingPlotter or MultiPing have the ability to natively generate an SNMP Trap message, but both programs have the ability to launch an external executable which can do this.

There are numerous command line utilities available that can generate an SNMP trap message, one free example of this is available at https://ezfive.com/snmpsoft-tools/snmp-trap-gen/. This utility will allow you to generate an SNMP trap using the PingPlotter or MultiPing alert system.

There are other utilities available, but for this example, we will be using the SnmpTrapGen program linked above and PingPlotter. MultiPing will work very similarly, however.

  1. Download the SnmpTrapGen utility (or ascertain the location and usage model of the utility of your choice).
  2. Extract the utility to a working directory. We will, for this example, be extracting to c:\tools\snmp. If this isn't your location, please adjust these instructions accordingly.
  3. Determine the IP Address and Port of your receiving SNMP agent/server.
  4. Create a new alert in PingPlotter. Set up the conditions you want to apply (see our tutorial for more information about alert setup).
  5. Set an event for "Launch an executable". Set it to notify "when alert conditions start (enters alert state)."
  6. Set the command to:
    c:\tools\snmp\SnmpTrapGen.exe
  7. Set the parameters to:

    -d localhost -v 1.2.3.4 STRING "$host - Alert Started"

  8. Or something like this (example IPs):

    -r:192.168.1.108 -v:2 -to:192.168.1.117

  9. Replace the -d parameter with your server. If your server port is not 162, then add the -p parameter to set your port.
  10. Change the -v to an event identifier you will use for PingPlotter. NOTE: You can also use a different type (i.e. INTEGER, COUNTER would be other common strings you may use) in place of STRING in the above example with an appropriate value for that TYPE of course.
  11. Change the message if required.
  12. Add another event with similar settings to notify "when alert conditions end". Change the string to match the condition ending.
Now, tie that event to a target of your choice and test it.

If you have something other than the normal (for most devices or systems) default Community Name of "public" setup for security reasons, you will have to specify it with "-c communityName" (without the quotes).



Article ID: 31
Created On: August 24, 2004
Last Updated On: August 19, 2020

Online URL: https://www.pingman.com/kb/article/generating-a-snmp-trap-from-pingplotter-or-multiping-31.html