Module: check_mk
Branch: master
Commit: 2fd617ebc918bcf2531b9bea3ac0256f27bb8348
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2fd617ebc918bc…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Apr 17 11:43:59 2018 +0200
5837 FIX Fixed overflow event text for local limits.
The event text of overflow events always contained the global limit, even
when the reason for the overflow event was a local limit. This has been
fixed.
Change-Id: Ic35b739560a970a394702655f14ab8cba99d40bb
---
.werks/5837 | 12 ++++++++++++
cmk/ec/main.py | 10 +++++-----
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/.werks/5837 b/.werks/5837
new file mode 100644
index 0000000..aa0a9e5
--- /dev/null
+++ b/.werks/5837
@@ -0,0 +1,12 @@
+Title: Fixed overflow event text for local limits.
+Level: 1
+Component: ec
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1523958152
+Class: fix
+
+The event text of overflow events always contained the global limit, even
+when the reason for the overflow event was a local limit. This has been
+fixed.
diff --git a/cmk/ec/main.py b/cmk/ec/main.py
index 7bc7013..0b4e0a1 100644
--- a/cmk/ec/main.py
+++ b/cmk/ec/main.py
@@ -3010,7 +3010,7 @@ class EventServer(ECServerThread):
# events will be stopped.
# Perform one time actions
- overflow_event = self._create_overflow_event(ty, event)
+ overflow_event = self._create_overflow_event(ty, event, limit)
if "overflow" in action:
self.logger.info(" Creating overflow event")
@@ -3043,7 +3043,7 @@ class EventServer(ECServerThread):
return limit, action
- def _create_overflow_event(self, ty, event):
+ def _create_overflow_event(self, ty, event, limit):
now = time.time()
new_event = {
"rule_id": None,
@@ -3072,7 +3072,7 @@ class EventServer(ECServerThread):
new_event["text"] = (
"The overall event limit of %d open events has been reached. Not
"
"opening any additional event until open events have been "
- "archived." %
self._config["event_limit"]["overall"]["limit"]
+ "archived." % limit
)
elif ty == "by_host":
@@ -3082,7 +3082,7 @@ class EventServer(ECServerThread):
"text": (
"The host event limit of %d open events has been reached for
host \"%s\". "
"Not opening any additional event for this host until open
events have "
- "been archived." %
(self._config["event_limit"]["by_host"]["limit"],
event["host"])
+ "been archived." % (limit, event["host"])
)
})
@@ -3100,7 +3100,7 @@ class EventServer(ECServerThread):
"The rule event limit of %d open events has been reached for
rule \"%s\". "
"Not opening any additional event for this rule until open
events have "
"been archived." %
-
(self._config["event_limit"]["by_rule"]["limit"],
event["rule_id"])
+ (limit, event["rule_id"])
)
})