Module: check_mk
Branch: master
Commit: 8a2a89c0ccd7e0f11316a6731c94cbfe1b8837d5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8a2a89c0ccd7e0…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Wed Jun 28 13:40:44 2017 +0200
4938 FIX Make sure that a notification has the plugin output available
Plugin output in notifications can be either host-related or service-related.
Make sure that the resulting notification has always access to the right
kind. Previously notifications triggered e.g. by the event console could
have an empty plugin output.
Note: This was a bug introduced in 1.4.0p6, earlier versions were not
affected.
Change-Id: I56d7c69bea3a3a653953edee7b10b107ab0c1901
---
.werks/4938 | 16 ++++++++++++++++
modules/events.py | 3 ++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/.werks/4938 b/.werks/4938
new file mode 100644
index 0000000..9c051cb
--- /dev/null
+++ b/.werks/4938
@@ -0,0 +1,16 @@
+Title: Make sure that a notification has the plugin output available
+Level: 1
+Component: notifications
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1498649743
+Class: fix
+
+Plugin output in notifications can be either host-related or service-related.
+Make sure that the resulting notification has always access to the right
+kind. Previously notifications triggered e.g. by the event console could
+have an empty plugin output.
+
+Note: This was a bug introduced in 1.4.0p6, earlier versions were not
+affected.
diff --git a/modules/events.py b/modules/events.py
index 3d21fa9..8f16144 100644
--- a/modules/events.py
+++ b/modules/events.py
@@ -337,7 +337,8 @@ def complete_raw_context(raw_context, with_dump, event_log):
raw_context['HOSTFORURL'] =
urllib.quote(raw_context['HOSTNAME'])
# Add HTML formated plugin output
- raw_context["HOSTOUTPUT_HTML"] =
format_plugin_output(raw_context["HOSTOUTPUT"])
+ if "HOSTOUTPUT" in raw_context:
+ raw_context["HOSTOUTPUT_HTML"] =
format_plugin_output(raw_context["HOSTOUTPUT"])
if raw_context["WHAT"] == "SERVICE":
raw_context["SERVICEOUTPUT_HTML"] =
format_plugin_output(raw_context["SERVICEOUTPUT"])
raw_context["LONGSERVICEOUTPUT_HTML"] =
format_plugin_output(raw_context["LONGSERVICEOUTPUT"])