Search in sources :

Example 31 with Value

use of org.opennms.netmgt.xml.event.Value in project opennms by OpenNMS.

the class ThresholdEntity method sendRearmForTriggeredStates.

private void sendRearmForTriggeredStates() {
    for (String instance : m_thresholdEvaluatorStates.keySet()) {
        for (ThresholdEvaluatorState state : m_thresholdEvaluatorStates.get(instance)) {
            if (state.isTriggered()) {
                Event e = state.getEventForState(Status.RE_ARMED, new Date(), Double.NaN, null);
                Parm p = new Parm();
                p.setParmName("reason");
                Value v = new Value();
                v.setContent("Configuration has been changed");
                p.setValue(v);
                e.addParm(p);
                LOG.info("sendRearmForTriggeredStates: sending rearm for {}", e);
                ThresholdingEventProxyFactory.getFactory().getProxy().add(e);
                state.clearState();
            }
        }
    }
}
Also used : Value(org.opennms.netmgt.xml.event.Value) Event(org.opennms.netmgt.xml.event.Event) Parm(org.opennms.netmgt.xml.event.Parm) Date(java.util.Date)

Example 32 with Value

use of org.opennms.netmgt.xml.event.Value in project opennms by OpenNMS.

the class PassiveStatusKeeperIT method buildParm.

private Parm buildParm(String parmName, String parmValue) {
    Value v = new Value();
    v.setContent(parmValue);
    Parm p = new Parm();
    p.setParmName(parmName);
    p.setValue(v);
    return p;
}
Also used : Value(org.opennms.netmgt.xml.event.Value) Parm(org.opennms.netmgt.xml.event.Parm)

Example 33 with Value

use of org.opennms.netmgt.xml.event.Value in project opennms by OpenNMS.

the class EventTranslatorIT method buildParm.

private Parm buildParm(String parmName, String parmValue) {
    Value v = new Value();
    v.setContent(parmValue);
    Parm p = new Parm();
    p.setParmName(parmName);
    p.setValue(v);
    return p;
}
Also used : Value(org.opennms.netmgt.xml.event.Value) Parm(org.opennms.netmgt.xml.event.Parm)

Aggregations

Value (org.opennms.netmgt.xml.event.Value)33 Parm (org.opennms.netmgt.xml.event.Parm)31 InetAddress (java.net.InetAddress)5 Event (org.opennms.netmgt.xml.event.Event)5 ArrayList (java.util.ArrayList)4 Date (java.util.Date)3 Test (org.junit.Test)3 OnmsNode (org.opennms.netmgt.model.OnmsNode)3 PollableNode (org.opennms.netmgt.poller.pollables.PollableNode)3 EventHandler (org.opennms.netmgt.events.api.annotations.EventHandler)2 OnmsEvent (org.opennms.netmgt.model.OnmsEvent)2 OnmsIpInterface (org.opennms.netmgt.model.OnmsIpInterface)2 PollableInterface (org.opennms.netmgt.poller.pollables.PollableInterface)2 SnmpValue (org.opennms.netmgt.snmp.SnmpValue)2 Logmsg (org.opennms.netmgt.xml.event.Logmsg)2 Snmp (org.opennms.netmgt.xml.event.Snmp)2 BufferedReader (java.io.BufferedReader)1 StringReader (java.io.StringReader)1 InetSocketAddress (java.net.InetSocketAddress)1 HashMap (java.util.HashMap)1