use of org.opennms.protocols.snmp.SnmpTrapSession in project opennms by OpenNMS.
the class JoeSnmpStrategy method send.
public static void send(final String destAddr, final int destPort, final String community, final SnmpPduRequest pdu) throws Exception {
SnmpTrapSession trapSession = getTrapSession();
SnmpPeer peer = new SnmpPeer(InetAddress.getByName(destAddr), destPort);
SnmpParameters parms = new SnmpParameters(community);
parms.setVersion(SnmpSMI.SNMPV2);
peer.setParameters(parms);
trapSession.send(peer, pdu);
}
use of org.opennms.protocols.snmp.SnmpTrapSession in project opennms by OpenNMS.
the class JoeSnmpStrategy method registerForTraps.
@Override
public void registerForTraps(final TrapNotificationListener listener, InetAddress address, int snmpTrapPort) throws IOException {
final RegistrationInfo info = new RegistrationInfo(listener, address, snmpTrapPort);
final JoeSnmpTrapNotifier m_trapHandler = new JoeSnmpTrapNotifier(listener);
info.setHandler(m_trapHandler);
SnmpTrapSession m_trapSession = new SnmpTrapSession(m_trapHandler, address, snmpTrapPort);
info.setSession(m_trapSession);
s_registrations.put(listener, info);
}
use of org.opennms.protocols.snmp.SnmpTrapSession 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);
}
Aggregations