translated events are displayed like the original event
Description
Environment
Acceptance / Success Criteria
Lucidchart Diagrams
Activity

Alejandro Galue August 8, 2011 at 5:49 PM
The solution has been verified on branch 1.8
Cherry-picked on revision 882f24cfe734efae0773554e14cf18af71227b41 for 1.8

Alejandro Galue August 8, 2011 at 4:27 PM
Dominik is right. The problem is related only with the event's description.
The solution is just add the following line on the method cloneEvent:
clonedEvent.setDescr(null);
Committed into revision 1e72378add9fd64d8672f307926219371e2ccfaf for 1.10.

Alejandro Galue September 8, 2010 at 11:11 AM
On my experiments, with Cisco version for SNMP_Link_Down and SNMP_Link_Up, defined on Cisco.events.xml, the problem affects both, description and logmessage.
My first attempt shows me a more critical error: if I set the original event as "donotpersist", the translated event won't be persisted because it has the same logmessage. So I let both as "logndisplay".
I applied a simple patch:
diff --git a/opennms-services/src/main/java/org/opennms/netmgt/config/EventTranslatorConfigFactory.java b/opennms-services/src/main/java/org/opennms/netmgt/config/
index 88432c4..3bf1305 100644
— a/opennms-services/src/main/java/org/opennms/netmgt/config/EventTranslatorConfigFactory.java
+++ b/opennms-services/src/main/java/org/opennms/netmgt/config/EventTranslatorConfigFactory.java
@@ -446,6 +446,8 @@ public final class EventTranslatorConfigFactory implements EventTranslatorConfig
eventd using the data from eventconf, we unset it here to eventd
can reset to the proper new settings.
*/
+ clonedEvent.setLogmsg(null); // Fix for bugs 4000 and 4017
+ clonedEvent.setDescr(null); // Fix for bugs 4000 and 4017
clonedEvent.setAlarmData(null);
clonedEvent.setSeverity(null);
return clonedEvent;
The patch make sense because of the explanation of why setAlarmData and setSeverity are set to null.
After restart with the new jar, the event page now shows logmessage and description as expected.
BUT if I mark again the original message as "donotpersist", it is still persisted, and I don't know why.
Maybe the patch is not correct, or I am missing something.
Any thoughts?

Alejandro Galue September 8, 2010 at 10:59 AM
has been marked as a duplicate of this bug. ***

Dominik July 30, 2010 at 5:04 AM
Interestingly, this does not seem to be true for the event label (eventlogmsg in the DB). But the description is not taken from the actual event's definition, but from the original event's definition.
opennms=# select eventlogmsg,eventuei,eventsource,eventdescr,eventparms from events where eventid in (883123,883124);
[ RECORD 1 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
eventlogmsg | Node is down.
eventuei | uei.opennms.org/nodes/nodeDown
eventsource | OpenNMS.Poller.DefaultPollContext
eventdescr | <p>All interfaces on node are down.</p> <p>This event is generated when node outage processing determines that all interfaces on the node are down.</p> <p>New outage records have been created and service level availability calculations will be impacted until this outage is resolved.</p>
eventparms |
[ RECORD 2 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
eventlogmsg | Node zzz dk test is down.
eventuei | uei.opennms.org/intelegence/nodeDownEventWithIpAddresses
eventsource | OpenNMS.EventTranslator
eventdescr | <p>All interfaces on node are down.</p> <p>This event is generated when node outage processing determines that all interfaces on the node are down.</p> <p>New outage records have been created and service level availability calculations will be impacted until this outage is resolved.</p>
eventparms | ipaddresses={1.1.1.1,2.2.2.2,3.3.3.3,4.4.4.4,5.5.5.5}(string,text)
While translating the nodeDown event (see #3999), I also created a new event definition for a nodeDown event that includes ip Addresses.
This included %parm[ipaddresses]%.
However, the new event is displayed just like the original nodeDown event (which was the translation source), so the new parameter is not displayed in the web UI.
opennms=# select eventuei,eventsource,eventdescr,eventparms from events where eventid in (883123,883124);
[ RECORD 1 ]------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- eventuei | uei.opennms.org/nodes/nodeDown
eventsource | OpenNMS.Poller.DefaultPollContext
eventdescr | <p>All interfaces on node are down.</p> <p>This event is generated when node outage processing determines that all interfaces on the node are down.</p> <p>New outage records have been created and service level availability calculations will be impacted until this outage is resolved.</p>
eventparms |
[ RECORD 2 ]------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- eventuei | uei.opennms.org/intelegence/nodeDownEventWithIpAddresses
eventsource | OpenNMS.EventTranslator
eventdescr | <p>All interfaces on node are down.</p> <p>This event is generated when node outage processing determines that all interfaces on the node are down.</p> <p>New outage records have been created and service level availability calculations will be impacted until this outage is resolved.</p>
eventparms | ipaddresses={1.1.1.1,2.2.2.2,3.3.3.3,4.4.4.4,5.5.5.5}(string,text)
The new event is defined in a custom event file, which is included in eventconf.xml
shell # tail eventconf.xml
<event-file>events/hostedpbx.events.xml</event-file>
<event-file>events/Standard.events.xml</event-file>
<event-file>events/Translator.default.events.xml</event-file>
<event-file>events/default.events.xml</event-file>
</events>
shell # cat events/hostedpbx.events.xml
<events>
<event>
<uei>uei.opennms.org/intelegence/nodeDownEventWithIpAddresses</uei>
<event-label>OpenNMS-defined node event: nodeDown</event-label>
<descr>
<p>All interfaces on node %nodelabel% are
down.</p> <p>This event is generated when node
outage processing determines that all interfaces on the node
are down.</p> <p>New outage records have been
created and service level availability calculations will be
impacted until this outage is resolved.</p> <p>IP Addresses: %parm[ipaddresses]%</p>
</descr>
<logmsg dest='logndisplay'>
Node %nodelabel% is down. %parm[eventReason]%
</logmsg>
<severity>Major</severity>
</event>
</events>
The event is also not defined anywhere else (I thought maybe it also was auto-generated in the translator file or something):
grep intelegence *
hostedpbx.events.xml: <uei>uei.opennms.org/intelegence/nodeDownEventWithIpAddresses</uei>
It would be great if the new event would honor its own event definition.