Module: check_mk
Branch: master
Commit: fe0e5bf73615b590aaf27416faea6df75820c8b8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fe0e5bf73615b5…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Nov 3 09:55:22 2014 +0100
#1483 FIX Savely replace illegal vertical bars in check plugin output
If a check plugin has a vertical bar in its plugin output then the core chopped
off the remaining text and interpreted that is performance values. That was
for example the case when monitoring SAP R/3 jobs. This has now been fixed
by automatically replacing the bar by the Unicode character LIGHT VERTICAL BAR
(U+2758).
---
.werks/1483 | 14 ++++++++++++++
ChangeLog | 3 +++
modules/check_mk_base.py | 6 ++++++
3 files changed, 23 insertions(+)
diff --git a/.werks/1483 b/.werks/1483
new file mode 100644
index 0000000..8bba522
--- /dev/null
+++ b/.werks/1483
@@ -0,0 +1,14 @@
+Title: Savely replace illegal vertical bars in check plugin output
+Level: 1
+Component: core
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.5i7
+Date: 1415004782
+
+If a check plugin has a vertical bar in its plugin output then the core chopped
+off the remaining text and interpreted that is performance values. That was
+for example the case when monitoring SAP R/3 jobs. This has now been fixed
+by automatically replacing the bar by the Unicode character LIGHT VERTICAL BAR
+(U+2758).
diff --git a/ChangeLog b/ChangeLog
index 69fd65b..13f68ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
1.2.5i7:
+ Core & Setup:
+ * 1483 FIX: Savely replace illegal vertical bars in check plugin output...
+
Checks & Agents:
* 1197 climaveneta_temp: New check for temperature sensors on Climaveneta clima
devices
* 1167 citrix_license/esx_license: Can now be configured to always show OK as state
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 750349f..889c143 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1402,6 +1402,12 @@ def submit_check_result(host, servicedesc, result, sa):
infotext.startswith("UNKNOWN -")):
infotext = nagios_state_names[state] + " - " + infotext
+ # make sure that plugin output does not contain a vertical bar. If that is the
+ # case then replace it with a Uniocode "Light vertical bar"
+ if type(infotext) == unicode:
+ infotext = infotext.encode("utf-8") # should never happen
+ infotext = infotext.replace("|", "\xe2\x9d\x98")
+
global nagios_command_pipe
# [<timestamp>]
PROCESS_SERVICE_CHECK_RESULT;<host_name>;<svc_description>;<return_code>;<plugin_output>