javasnmpsnmp-trap

Send trap v2 in Java


How can I send snmpv2 traps from Java application. I tried to do example on snmp4j, but it didn't work.


Solution

  • I use SNMP4J for this.

    This javadoc might help you write your code. You can use the Snmp.trap() method

    Edit:

    Well, I dont have code of my own at this moment, but you may refer this one . You have to use Snmp.notify() for sending V2 trap instead of Snmp.trap() as trap() only supports sending V1 traps.