show-event-config displays unexpected content after adding new event definitions

Description

A customer asked me if there is a way to alter the content of event definitions coming from OIA. In particular, an event defined by ALEC.

That is entirely possible by creating a new event definition with a priority element.

The problem is that after doing that, and instruction OpenNMS to reload the event configuration, the number of events displayed by the show-event-config command is incorrect.

Let me explain with an example:

 

 

The above is the expected result for that event definition. The first entry is coming from ALEC, as defined in the following link:

https://github.com/OpenNMS/alec/blob/v1.0.2/integrations/opennms/config/src/main/resources/events/Cisco.ext.events.xml#L475

The second one is part of the OpenNMS default configuration (defined inside /opt/opennms/etc/events/Cisco.events.xml).

As expected, event definitions coming via OIA takes more precedence than definitions that OpenNMS provides by default.

This can be altered with the priority field.

I added a new event definitions file with an altered version of the event offered by ALEC:

 

 

If I run the show-event-config again, I would expect to see three (3) definitions, having the one I added at the top of the list due to its priority. Instead, I'm seeing six (6) copies of the definition I just added, and the ones that were already present are gone.

 

 

That is definitely not expected.

Interestingly, if I restart OpenNMS, to see if the behavior was due to the reload process, I found that the problem is now worst. It shows ten (10) entries:

 

 

And, the original definitions are still not displayed.

I don't know if there are repercussions or now because of this. Probably not in terms of behavior, but I'm wondering about the algorithm to find event definitions. That because if this process is repeated for multiple definitions, that will exponentially increase the number of definitions kept in memory and could have side effects on the time invested in processing events before sending them to the Event Bus.

 

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:
Fixed

Details

Assignee

Reporter

Labels

HB Backlog Status

Story Points

Components

Sprint

Affects versions

Priority

PagerDuty

Created August 20, 2020 at 1:29 PM
Updated July 22, 2022 at 6:02 PM
Resolved February 14, 2022 at 3:14 PM
Loading...