Module: check_mk
Branch: master
Commit: 4aeb412d483bfad1a96ee76ae135fb63b8ca69c0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4aeb412d483bfa…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 19 14:09:17 2016 +0100
4156 FIX Fix off-by-one error in EC limit handling
If the limit was e.g. 10 in fact 11 message would have been
allowed (<b>plus</b> the overflow event). This has been fixed.
Change-Id: I0890b7899dd29056f717c115c889d74e17511421
---
.werks/4156 | 10 ++++++++++
ChangeLog | 1 +
bin/mkeventd | 5 +++--
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/4156 b/.werks/4156
new file mode 100644
index 0000000..eb02a8b
--- /dev/null
+++ b/.werks/4156
@@ -0,0 +1,10 @@
+Title: Fix off-by-one error in EC limit handling
+Level: 1
+Component: ec
+Compatible: compat
+Version: 1.4.0i4
+Date: 1482152918
+Class: fix
+
+If the limit was e.g. 10 in fact 11 message would have been
+allowed (<b>plus</b> the overflow event). This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index 23d9953..122a8dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
* 4154 Do not send notifications if host found and currently in downtime...
NOTE: Please refer to the migration notes!
* 4155 FIX: Do not perform actions on events if overflow limit is active...
+ * 4156 FIX: Fix off-by-one error in EC limit handling...
1.4.0i3:
diff --git a/bin/mkeventd b/bin/mkeventd
index 4ee5a5d..e6f7358 100755
--- a/bin/mkeventd
+++ b/bin/mkeventd
@@ -2733,8 +2733,9 @@ class EventServer:
action = g_config["event_limit"][ty]["action"]
verbose(" Type: %s, Open events: %d, Limit: %d" % (ty, num, limit))
- below_limit = num < limit
- above_limit = num > limit
+ # Check limit under assumption that one more event would be opened
+ below_limit = num < (limit-1)
+ above_limit = num >= limit
if below_limit:
return False # Fine. Hand over to next check.