Module: check_mk
Branch: master
Commit: 25a9b56d70dc9626a72564d0e9e88412ad594cc1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=25a9b56d70dc96…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Feb 5 14:20:15 2013 +0100
cmk --notify: improved logging on wrong notification type
---
ChangeLog | 1 +
modules/notify.py | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ded1aa4..977dc9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,7 @@
* FIX: Inventory for cluster nodes who are part of multiple clusters
* cmk --notify: added plugin for sms notification
* FIX: precompiled checks: correct handling of sys.exit() call when using python2.4
+ * cmk --notify: improved logging on wrong notification type
Checks & Agents:
* winperf_processor now outputs float usage instead of integer
diff --git a/modules/notify.py b/modules/notify.py
index 6742b1b..eb4bf17 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -360,8 +360,9 @@ def notify_flexible(contact, context, notification_table):
# Check notification type
event, allowed_events = check_notification_type(context,
entry["host_events"], entry["service_events"])
if event not in allowed_events:
- notify_log(" - Skipping: wrong notification type %s, only %s are
allowed" %
- (event, ",".join(allowed_events)) )
+ notification_type = context.get("NOTIFICATIONTYPE","")
+ notify_log(" - Skipping: wrong notification type %s (%s), only %s are
allowed" %
+ (event, notification_type, ",".join(allowed_events)) )
continue
# Check notification number (in case of repeated notifications/escalations)