Module: check_mk
Branch: master
Commit: 27ebcfe6acaeb63a13ec8c7c7b1a223ab61e4199
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=27ebcfe6acaeb6…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Apr 18 16:32:06 2017 +0200
4470 FIX Event console: fixed incorrect event counting for timed-out and heartbeat events
The internal event counter of status_num_open_events (and others) was not correctly
decreased for
<ul>
<li>events with timeouts, e.g. an event with a lifetime</li>
<li>events which expect something in a given interval</li>
</ul>
Since this event count never decreased, the limits specified in the global settings rule
<i>Limit amount of current events</i>,
were reached when the event console ran for a certain amount of time. A restart always
fixed this problem, because these counts
are calculated from scratch during startup.
Change-Id: Iab41625af9619217c80751933e196d87b9dacbd2
---
.werks/4470 | 19 +++++++++++++++++++
bin/mkeventd | 5 +++--
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/.werks/4470 b/.werks/4470
new file mode 100644
index 0000000..b9f51d4
--- /dev/null
+++ b/.werks/4470
@@ -0,0 +1,19 @@
+Title: Event console: fixed incorrect event counting for timed-out and heartbeat events
+Level: 1
+Component: ec
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1492524907
+Class: fix
+
+The internal event counter of status_num_open_events (and others) was not correctly
decreased for
+
+<ul>
+<li>events with timeouts, e.g. an event with a lifetime</li>
+<li>events which expect something in a given interval</li>
+</ul>
+
+Since this event count never decreased, the limits specified in the global settings rule
<i>Limit amount of current events</i>,
+were reached when the event console ran for a certain amount of time. A restart always
fixed this problem, because these counts
+are calculated from scratch during startup.
diff --git a/bin/mkeventd b/bin/mkeventd
index ace8a43..56f302d 100755
--- a/bin/mkeventd
+++ b/bin/mkeventd
@@ -1786,7 +1786,8 @@ class EventServer:
# Do delayed deletion now (was delayed in order to keep list indices OK)
for nr in events_to_delete[::-1]:
- del events[nr]
+ g_event_status.remove_event(events[nr])
+
def hk_check_expected_messages(self):
now = time.time()
@@ -1845,7 +1846,7 @@ class EventServer:
self.handle_absent_event(rule, 0, expected_count, interval_start)
for nr in events_to_delete[::1]:
- del events[nr]
+ g_event_status.remove_event(events[nr])
def handle_absent_event(self, rule, event_count, expected_count, interval_start):