Module: check_mk
Branch: master
Commit: 1b64aa2fedc8448c7ea4b48ff0f30a1b04d0b266
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1b64aa2fedc844…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jun 26 14:39:03 2014 +0200
Fix quoting of \ in custom checks with nagios core
When you are using Nagios as montitoring core then backslashes contained
in <tt>custom_checks</tt> (Classical active and passive Nagios checks) would
be interpreted by Nagios. That way single backslashes would usually vanish
und you would have to duplicate them.
The Check_MK Micro Core never interpreted these backslashes so it was
transparent for the user.
This fix changes the behaviour of Check_MK in a way that also with the
Nagios core you need only one backslash. Backslashes are transparent
now.
<b>NOTE</b>: If you have custom checks that contain backslashes (for
example as part of names or passwords) then you need to remove
duplicate backslashes after this update!
---
.werks/1012 | 22 ++++++++++++++++++++++
ChangeLog | 4 ++++
modules/check_mk.py | 2 +-
3 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/.werks/1012 b/.werks/1012
new file mode 100644
index 0000000..98744fe
--- /dev/null
+++ b/.werks/1012
@@ -0,0 +1,22 @@
+Title: Fix quoting of \ in custom checks with nagios core
+Level: 2
+Component: core
+Version: 1.2.5i5
+Date: 1403786142
+Class: incomp
+
+When you are using Nagios as montitoring core then backslashes contained
+in <tt>custom_checks</tt> (Classical active and passive Nagios checks) would
+be interpreted by Nagios. That way single backslashes would usually vanish
+und you would have to duplicate them.
+
+The Check_MK Micro Core never interpreted these backslashes so it was
+transparent for the user.
+
+This fix changes the behaviour of Check_MK in a way that also with the
+Nagios core you need only one backslash. Backslashes are transparent
+now.
+
+<b>NOTE</b>: If you have custom checks that contain backslashes (for
+example as part of names or passwords) then you need to remove
+duplicate backslashes after this update!
diff --git a/ChangeLog b/ChangeLog
index 488d804..c4938ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
1.2.5i5:
+ Core & Setup:
+ * 1012 Fix quoting of \ in custom checks with nagios core...
+ NOTE: Please refer to the migration notes!
+
Checks & Agents:
* 0994 FIX: agent plugin smart: fixed syntax error
* 0989 FIX: logwatch.ec: Fix forwarding multiple messages via syslog/TCP...
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 86dfb29..78c4403 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -2411,7 +2411,7 @@ define service {
continue
if command_line:
- command_line = autodetect_plugin(command_line)
+ command_line = autodetect_plugin(command_line).replace("\\",
"\\\\")
if "freshness" in entry:
freshness = " check_freshness\t\t1\n" + \