Module: check_mk
Branch: master
Commit: f05905cf5717139f05704574f480a4bc7573867c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f05905cf571713…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Mar 14 12:15:14 2013 +0100
FIX: fixed crash on host notification when contact had explicit services set
---
ChangeLog | 3 +++
modules/notify.py | 15 ++++++++-------
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 163230d..ded6142 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -80,6 +80,9 @@
* ADD: wmic_processs: cpucores now being considered when calculating
user/kernel percentages. (thanks to William Baum)
+ Notifications:
+ * FIX: fixed crash on host notification when contact had explicit services set
+
Livestatus:
* FIX: possible crash with VERY long downtime comments
diff --git a/modules/notify.py b/modules/notify.py
index b0e5ab3..28c100c 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -432,14 +432,15 @@ def should_notify(context, entry):
if entry.get("only_services"):
servicedesc = context.get("SERVICEDESC")
if not servicedesc:
- notify_log(" - Skipping: limited to certain services, but this is a host
notification")
- for s in entry["only_services"]:
- if re.match(s, servicedesc):
- break
+ notify_log(" - Proceed: limited to certain services, but this is a host
notification")
else:
- notify_log(" - Skipping: service '%s' matches non of %s" %
(
- servicedesc, ", ".join(entry["only_services"])))
- return False
+ for s in entry["only_services"]:
+ if re.match(s, servicedesc):
+ break
+ else:
+ notify_log(" - Skipping: service '%s' matches non of
%s" % (
+ servicedesc, ", ".join(entry["only_services"])))
+ return False
# Check notification type
event, allowed_events = check_notification_type(context,
entry["host_events"], entry["service_events"])