Module: check_mk
Branch: master
Commit: 2da6988954109d7ca125a111c531000a960ff7a1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2da6988954109d…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Dec 12 17:43:19 2013 +0100
FIX Prevent service notification on host alerts
In some case the notfication template for services was used, even is was an host problem.
---
.werks/108 | 10 ++++++++++
ChangeLog | 3 +++
modules/notify.py | 2 +-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/108 b/.werks/108
new file mode 100644
index 0000000..40bf5cb
--- /dev/null
+++ b/.werks/108
@@ -0,0 +1,10 @@
+Title: Prevent service notification on host alerts
+Level: 1
+Component: notifications
+Class: fix
+State: unknown
+Version: 1.2.3i8
+Date: 1386866484
+Targetversion: future
+
+In some case the notfication template for services was used, even is was an host
problem.
diff --git a/ChangeLog b/ChangeLog
index 6f2b8eb..174d451 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,6 +34,9 @@
* 0309 FIX: Trying to prevent read/write conflicts with a large user base...
* 0311 FIX: Fixed "Inventory failed" message when trying an inventory on
clusters via WATO...
+ Notifications:
+ * 0108 FIX: Prevent service notification on host alerts...
+
Reporting & Availability:
* 0018 New option for displaying a legend for the colors used in the timeline...
diff --git a/modules/notify.py b/modules/notify.py
index 2183da1..f72e5b9 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -510,7 +510,7 @@ def notify_via_email(context, write_into_spoolfile):
notify_log(substitute_context(notification_log_template, context))
- if "SERVICEDESC" in context:
+ if "SERVICEDESC" in context and context['SERVICEDESC'].strip():
subject_t = notification_service_subject
body_t = notification_service_body
else: