Search in sources :

Example 11 with SnmpV3TrapBuilder

use of org.opennms.netmgt.snmp.SnmpV3TrapBuilder in project opennms by OpenNMS.

the class SnmpTrapForwarderHelper method sendV3EventInform.

public void sendV3EventInform(Event event) throws UnknownHostException, SnmpTrapHelperException {
    long trapTimeStamp = 0;
    SnmpTrapBuilder trap = snmpTrapHelper.createV3Inform(".1.3.6.1.4.1.5813.1.1", Long.toString(trapTimeStamp));
    trap = buildEventTrap(event, trap, null);
    SnmpV3TrapBuilder inform = (SnmpV3TrapBuilder) trap;
    try {
        inform.sendInform(getIp(), getPort(), getTimeout(), getRetries(), getSecurityLevel(), getSecurityname(), getAuthPassPhrase(), getAuthProtocol(), getPrivPassPhrase(), getPrivprotocol());
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : SnmpV3TrapBuilder(org.opennms.netmgt.snmp.SnmpV3TrapBuilder) UnknownHostException(java.net.UnknownHostException) SnmpTrapBuilder(org.opennms.netmgt.snmp.SnmpTrapBuilder)

Example 12 with SnmpV3TrapBuilder

use of org.opennms.netmgt.snmp.SnmpV3TrapBuilder in project opennms by OpenNMS.

the class SnmpTrapForwarderHelper method sendV3EndSyncTrap.

public void sendV3EndSyncTrap() {
    long trapTimeStamp = 0;
    try {
        SnmpV3TrapBuilder trap = snmpTrapHelper.createV3Trap(".1.3.6.1.4.1.5813.1.6", Long.toString(trapTimeStamp));
        trap.send(getIp(), getPort(), getSecurityLevel(), getSecurityname(), getAuthPassPhrase(), getAuthProtocol(), getPrivPassPhrase(), getPrivprotocol());
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : SnmpV3TrapBuilder(org.opennms.netmgt.snmp.SnmpV3TrapBuilder) UnknownHostException(java.net.UnknownHostException)

Example 13 with SnmpV3TrapBuilder

use of org.opennms.netmgt.snmp.SnmpV3TrapBuilder in project opennms by OpenNMS.

the class SnmpTrapForwarderHelper method sendV3EventTrap.

public void sendV3EventTrap(Event event) throws UnknownHostException, SnmpTrapHelperException {
    long trapTimeStamp = 0;
    SnmpTrapBuilder trap = snmpTrapHelper.createV3Trap(".1.3.6.1.4.1.5813.1.1", Long.toString(trapTimeStamp));
    trap = buildEventTrap(event, trap, null);
    SnmpV3TrapBuilder v3trap = (SnmpV3TrapBuilder) trap;
    try {
        v3trap.send(getIp(), getPort(), getSecurityLevel(), getSecurityname(), getAuthPassPhrase(), getAuthProtocol(), getPrivPassPhrase(), getPrivprotocol());
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : SnmpV3TrapBuilder(org.opennms.netmgt.snmp.SnmpV3TrapBuilder) UnknownHostException(java.net.UnknownHostException) SnmpTrapBuilder(org.opennms.netmgt.snmp.SnmpTrapBuilder)

Aggregations

SnmpV3TrapBuilder (org.opennms.netmgt.snmp.SnmpV3TrapBuilder)13 UnknownHostException (java.net.UnknownHostException)8 SnmpTrapBuilder (org.opennms.netmgt.snmp.SnmpTrapBuilder)5 SnmpAgentConfig (org.opennms.netmgt.snmp.SnmpAgentConfig)2 SnmpInstId (org.opennms.netmgt.snmp.SnmpInstId)1 SnmpObjId (org.opennms.netmgt.snmp.SnmpObjId)1 OctetString (org.snmp4j.smi.OctetString)1