Module: check_mk
Branch: master
Commit: 1efb6cd92cca8932e192b208abc80a83dff84c05
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1efb6cd92cca89…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 8 10:46:06 2013 +0100
FIX: When a single rule matching raises an exception, the line is now
matched agains the following rules instead of being skipped. The
exception is logged to mkeventd.log
---
ChangeLog | 3 +++
mkeventd/bin/mkeventd | 9 ++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fc9d552..95f47bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -83,6 +83,9 @@
during "activate changes" process
* Added hook mkeventd-activate-changes to add custom actions to the mkeventd
"activate changes" GUI function
+ * FIX: When a single rule matching raises an exception, the line is now
+ matched agains the following rules instead of being skipped. The
+ exception is logged to mkeventd.log
1.2.1i5:
Core:
diff --git a/mkeventd/bin/mkeventd b/mkeventd/bin/mkeventd
index fc05d77..fa58bff 100755
--- a/mkeventd/bin/mkeventd
+++ b/mkeventd/bin/mkeventd
@@ -1218,7 +1218,11 @@ class EventServer:
rule_candidates = self._rules
for rule in rule_candidates:
- result = self.event_rule_matches(rule, event)
+ 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
@@ -1280,7 +1284,6 @@ class EventServer:
do_rule_actions(rule, event)
return
-
# Checks if an event matches a rule. Returns either False (no match)
# or a pair of matchtype, groups, where matchtype is False for a
# normal match and True for a cancelling match and the groups is a tuple
@@ -1307,7 +1310,7 @@ class EventServer:
log(" did not match because of wrong application '%s'
(need '%s')" %
(event["application"],
pattern(rule.get("match_application"))))
return False
-
+
if "match_facility" in rule and event["facility"] !=
rule["match_facility"]:
if debug:
log(" did not match because of wrong syslog facility")