events written to DB although dest=suppress

Description

According to http://opennms.org/wiki/Event_Configuration_How-To#Internal_Events suppress should not put the event anywhere. It is still written to the DB though. How to reproduce:

<event>
<uei>uei.opennms.org/test/suppress</uei>
<event-label>suppress test</event-label>
<descr>suppress test</descr>
<logmsg dest="suppress">suppress test</logmsg>
<severity>Major</severity>
</event>

send-event.pl uei.opennms.org/test/suppress

opennms=# select eventtime,eventid from events where eventuei = 'uei.opennms.org/test/suppress' order by eventuei;
eventtime | eventid
----------------------------+--------- 2010-07-14 10:16:32.437+02 | 14345

eventd.log attached as log.txt

Environment

Operating System: Linux Platform: PC

Acceptance / Success Criteria

None

Attachments

2
  • 25 Oct 2011, 03:58 PM
  • 14 Jul 2010, 04:22 AM

Lucidchart Diagrams

Activity

Show:

Alejandro Galue October 26, 2011 at 11:45 AM

Seth has confirmed that it'll be fine to apply the suggested patch on 1.10.

Fixed on revision 1c2de3c40f98a7cc598b70e8498db84879733f07

Alejandro Galue October 25, 2011 at 3:58 PM

The attached patch should fix the behavior of "suppress".

If I understood correct, the idea of "suppress" is not only avoid write the event in the database but also skip sending the event to other daemons (in order to make it different from donotpersist).

make sense?

I tested it and it works.

The following log (from eventd.log) is showed when the event isn't being forwarded to other daemons (I've verified this using a simple event listener with Scriptd).

2011-10-25 15:18:28,929 DEBUG [EventHandlerPool-fiber3] EventIpcBroadcastProcessor: process: skip sending event uei.opennms.org/test/suppress to other daemons because is marked as suppress

The database does not contain any event as expected:

opennms_1993=# select eventtime,eventid from events where eventuei = 'uei.opennms.org/test/suppress' order by eventuei; eventtime | eventid -----------+--------- (0 rows)

Thoughts?

Seth Leger August 31, 2011 at 4:22 PM

It should be easy to verify/disprove this behavior with a unit test.

Dominik July 14, 2010 at 4:22 AM

Created an attachment (id=1050)
eventd.log

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

PagerDuty

Created July 14, 2010 at 4:22 AM
Updated January 27, 2017 at 4:26 PM
Resolved October 26, 2011 at 11:45 AM

Flag notifications