Search in sources :

Example 6 with SnmpPeer

use of org.opennms.protocols.snmp.SnmpPeer in project opennms by OpenNMS.

the class JoeSnmpStrategy method send.

public static void send(String destAddr, int destPort, String community, SnmpPduTrap trap) throws Exception {
    SnmpTrapSession trapSession = getTrapSession();
    SnmpPeer peer = new SnmpPeer(InetAddress.getByName(destAddr), destPort);
    SnmpParameters parms = new SnmpParameters(community);
    parms.setVersion(SnmpSMI.SNMPV1);
    peer.setParameters(parms);
    trapSession.send(peer, trap);
}
Also used : SnmpTrapSession(org.opennms.protocols.snmp.SnmpTrapSession) SnmpParameters(org.opennms.protocols.snmp.SnmpParameters) SnmpPeer(org.opennms.protocols.snmp.SnmpPeer)

Aggregations

SnmpPeer (org.opennms.protocols.snmp.SnmpPeer)6 SnmpParameters (org.opennms.protocols.snmp.SnmpParameters)5 SocketException (java.net.SocketException)3 SnmpObjectId (org.opennms.protocols.snmp.SnmpObjectId)3 SnmpSession (org.opennms.protocols.snmp.SnmpSession)3 SnmpSyntax (org.opennms.protocols.snmp.SnmpSyntax)3 SnmpValue (org.opennms.netmgt.snmp.SnmpValue)2 SnmpTrapSession (org.opennms.protocols.snmp.SnmpTrapSession)2