Module: check_mk
Branch: master
Commit: 103bba0c9002c0ddb1c882c317b15f430639939b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=103bba0c9002c0…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Nov 19 17:14:28 2012 +0100
fix two errors in code that broke some service notifications
---
ChangeLog | 3 +++
modules/notify.py | 4 ++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f6121e5..29303fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
Core:
* added HOST/SERVICEPROBLEMID to notification macros
+ Notifications:
+ * fix two errors in code that broke some service notifications
+
Event Console:
* New performance counter for client request processing time
* FIX: fixed bug in rule optimizer with ranges of syslog priorities
diff --git a/modules/notify.py b/modules/notify.py
index a0ee90d..e1ce824 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -189,7 +189,7 @@ def notify_via_email(context):
def notify_flexible(contact, context, notification_table):
notify_log("Flexible notification for %s" %
context["CONTACTNAME"])
- is_host = not context["SERVICEDESC"]
+ is_host = "SERVICEDESC" in context
for entry in notification_table:
plugin = entry["plugin"]
notify_log("Plugin: %s" % plugin)
@@ -296,7 +296,7 @@ def check_timeperiod(timeperiod):
def check_notification_type(context, host_events, service_events):
notification_type = context["NOTIFICATIONTYPE"]
- is_host = not context["SERVICEDESC"]
+ is_host = "SERVICEDESC" not in context
if is_host:
allowed_events = host_events
state = context["HOSTSTATE"]