Search in sources :

Example 21 with EventBuilder

use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.

the class ImpactProgagationRulesIT method createVpnPwDownEvent.

private Event createVpnPwDownEvent(int dbId, int nodeid, String ipaddr, String pwtype, String pwname) {
    Event event = new EventBuilder("uei.opennms.org/vendor/Juniper/traps/jnxVpnPwDown", "Test").setNodeid(nodeid).setInterface(addr(ipaddr)).addParam("jnxVpnPwVpnType", pwtype).addParam("jnxVpnPwVpnName", pwname).getEvent();
    event.setDbid(dbId);
    return event;
}
Also used : EventBuilder(org.opennms.netmgt.model.events.EventBuilder) Event(org.opennms.netmgt.xml.event.Event)

Example 22 with EventBuilder

use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.

the class EventMappingRulesIT method createVpnIfDownEvent.

private Event createVpnIfDownEvent(int dbId, int nodeid, String ipaddr, String pwtype, String pwname) {
    Event event = new EventBuilder("uei.opennms.org/vendor/Juniper/traps/jnxVpnIfDown", "Test").setNodeid(nodeid).setInterface(addr(ipaddr)).addParam("1.2.3.1", pwtype).addParam("1.2.3.2", pwname).getEvent();
    event.setDbid(dbId);
    return event;
}
Also used : EventBuilder(org.opennms.netmgt.model.events.EventBuilder) Event(org.opennms.netmgt.xml.event.Event)

Example 23 with EventBuilder

use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.

the class EventMappingRulesIT method createNodeDownEvent.

private Event createNodeDownEvent(int dbId, int nodeid) {
    Event event = new EventBuilder("uei.opennms.org/nodes/nodeDown", "Test").setNodeid(nodeid).getEvent();
    event.setDbid(dbId);
    return event;
}
Also used : EventBuilder(org.opennms.netmgt.model.events.EventBuilder) Event(org.opennms.netmgt.xml.event.Event)

Example 24 with EventBuilder

use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.

the class EventMappingRulesIT method createMplsLspPathDownEvent.

// dependencies must be loaded when needed by propagation rules
// loaded deps needed by multiple events should not load more than once
// deps no longer needed by one event should remain loaded if need by others
// deps no longer needed by any event should be unloaded
// propagate outages to 'dependsOn' parents
// propagate outages to 'dependsOnAny' parents when ALL children are down
// resolve outages in 'dependsOn' parents when dependsOn children are resolved
// resolve outage in 'dependsOnAny' parents when ANY child is resolved
// map various events to outages and resolutions
// ignore duplicate cause events
// ignore duplicate resolution events
private Event createMplsLspPathDownEvent(int dbId, int nodeid, String ipaddr, String lspname) {
    Event event = new EventBuilder("uei.opennms.org/vendor/Juniper/traps/mplsLspPathDown", "Test").setNodeid(nodeid).setInterface(addr(ipaddr)).addParam("1.2.3.1", lspname).getEvent();
    event.setDbid(dbId);
    return event;
}
Also used : EventBuilder(org.opennms.netmgt.model.events.EventBuilder) Event(org.opennms.netmgt.xml.event.Event)

Example 25 with EventBuilder

use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.

the class EventMappingRulesIT method createVpnIfUpEvent.

private Event createVpnIfUpEvent(int dbId, int nodeid, String ipaddr, String pwtype, String pwname) {
    Event event = new EventBuilder("uei.opennms.org/vendor/Juniper/traps/jnxVpnIfUp", "Test").setNodeid(nodeid).setInterface(addr(ipaddr)).addParam("1.2.3.1", pwtype).addParam("1.2.3.2", pwname).getEvent();
    event.setDbid(dbId);
    return event;
}
Also used : EventBuilder(org.opennms.netmgt.model.events.EventBuilder) Event(org.opennms.netmgt.xml.event.Event)

Aggregations

EventBuilder (org.opennms.netmgt.model.events.EventBuilder)305 Test (org.junit.Test)88 Event (org.opennms.netmgt.xml.event.Event)84 Date (java.util.Date)22 OnmsNode (org.opennms.netmgt.model.OnmsNode)17 InetAddress (java.net.InetAddress)16 EventProxyException (org.opennms.netmgt.events.api.EventProxyException)15 AlarmData (org.opennms.netmgt.xml.event.AlarmData)14 EventAnticipator (org.opennms.netmgt.dao.mock.EventAnticipator)12 ServletException (javax.servlet.ServletException)9 EventHandler (org.opennms.netmgt.events.api.annotations.EventHandler)9 Parm (org.opennms.netmgt.xml.event.Parm)9 Event (org.opennms.netmgt.xml.eventconf.Event)9 File (java.io.File)8 ArrayList (java.util.ArrayList)8 JUnitTemporaryDatabase (org.opennms.core.test.db.annotations.JUnitTemporaryDatabase)7 OnmsAlarm (org.opennms.netmgt.model.OnmsAlarm)7 OnmsIpInterface (org.opennms.netmgt.model.OnmsIpInterface)7 SyntaxToEvent (org.opennms.netmgt.model.events.snmp.SyntaxToEvent)7 Transactional (org.springframework.transaction.annotation.Transactional)6