Module: check_mk
Branch: master
Commit: 3e30758eea86d4db02c6be264569cdc6e392b718
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3e30758eea86d4…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Aug 11 10:43:00 2015 +0200
#2534 FIX Fixed implementation of skipping rule packs
---
.werks/2534 | 10 ++++++++++
ChangeLog | 1 +
mkeventd/bin/mkeventd | 7 +++++--
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/2534 b/.werks/2534
new file mode 100644
index 0000000..2ffe4bc
--- /dev/null
+++ b/.werks/2534
@@ -0,0 +1,10 @@
+Title: Fixed implementation of skipping rule packs
+Level: 1
+Component: ec
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1439282560
+
+
diff --git a/ChangeLog b/ChangeLog
index ab4f8d3..d97e7b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -179,6 +179,7 @@
* 2533 Allow inverted match in Event Console rules
* 2322 FIX: mkeventd: MIBs are now only loaded if SNMP Traps translation is
activated...
* 2460 FIX: Slightly more robust SNMP trap translation...
+ * 2534 FIX: Fixed implementation of skipping rule packs
Livestatus:
* 2493 FIX: Fixed wrong JSON format when using stats queries together with header
columns...
diff --git a/mkeventd/bin/mkeventd b/mkeventd/bin/mkeventd
index 11edaff..c01e81b 100755
--- a/mkeventd/bin/mkeventd
+++ b/mkeventd/bin/mkeventd
@@ -1874,15 +1874,17 @@ class EventServer:
skip_pack = None
for rule in rule_candidates:
- if skip_pack and rule["pack"] != skip_pack:
+ if skip_pack and rule["pack"] == skip_pack:
continue # still in the rule pack that we want to skip
skip_pack = None # new pack, reset skipping
try:
result = self.event_rule_matches(rule, event)
+
except Exception:
log(' Exception during matching:\n%s' % format_exception())
result = False
+
if result:
g_perfcounters.count("rule_hits")
cancelling, groups = result
@@ -1900,7 +1902,8 @@ class EventServer:
if rule["drop"] == "skip_pack":
skip_pack = rule["pack"]
if g_config["debug_rules"]:
- log(" skipping this rule pack")
+ log(" skipping this rule pack (%s)" % skip_pack)
+ continue
else:
g_perfcounters.count("drops")
return