Module: check_mk
Branch: master
Commit: d2131b9c22789f19ee828b377d10b9e34e21aed7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d2131b9c22789f…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Mar 1 16:08:51 2016 +0100
#3000 FIX Host check command: "Use a custom check plugin" was not working with
CMC
The setting "Use a custom check plugin" in the "Host Check Command"
rule caused
an exception on activate changes, when using the CMC.
---
.werks/3000 | 10 ++++++++++
ChangeLog | 1 +
modules/check_mk.py | 13 +++++++++++++
modules/nagios.py | 13 -------------
4 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/.werks/3000 b/.werks/3000
new file mode 100644
index 0000000..6d0eb8f
--- /dev/null
+++ b/.werks/3000
@@ -0,0 +1,10 @@
+Title: Host check command: "Use a custom check plugin" was not working with
CMC
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.9i1
+Date: 1456844854
+Class: fix
+
+The setting "Use a custom check plugin" in the "Host Check Command"
rule caused
+an exception on activate changes, when using the CMC.
diff --git a/ChangeLog b/ChangeLog
index fcb7d6b..9eb63df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -79,6 +79,7 @@
* 3182 FIX: Fix bulk operations based on search result folder...
* 2998 FIX: Fixed broken WATO rules where content is dynamically loaded...
* 3246 FIX: Fix link for editing a BI aggregation after coming back from the details
of another aggregation...
+ * 3000 FIX: Host check command: "Use a custom check plugin" was not working
with CMC...
Notifications:
* 3253 FIX: sms: notification script sms now handles single quotes in the message in
the right way
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 07573fe..4a2ac8e 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1107,6 +1107,19 @@ def extra_conf_of(confdict, hostname, service):
result += format % (key, values[0])
return result
+def autodetect_plugin(command_line):
+ plugin_name = command_line.split()[0]
+ if command_line[0] not in [ '$', '/' ]:
+ try:
+ for dir in [ "/local", "" ]:
+ path = omd_root + dir + "/lib/nagios/plugins/"
+ if os.path.exists(path + plugin_name):
+ command_line = path + command_line
+ break
+ except:
+ pass
+ return command_line
+
def host_check_command(hostname, ip, is_clust):
# Check dedicated host check command
values = host_extra_conf(hostname, host_check_commands)
diff --git a/modules/nagios.py b/modules/nagios.py
index 0769a2a..1bad72d 100644
--- a/modules/nagios.py
+++ b/modules/nagios.py
@@ -664,19 +664,6 @@ define service {
""" % (pingonly_template, descr, ping_command, arguments,
extra_service_conf_of(hostname, descr), hostname))
-def autodetect_plugin(command_line):
- plugin_name = command_line.split()[0]
- if command_line[0] not in [ '$', '/' ]:
- try:
- for dir in [ "/local", "" ]:
- path = omd_root + dir + "/lib/nagios/plugins/"
- if os.path.exists(path + plugin_name):
- command_line = path + command_line
- break
- except:
- pass
- return command_line
-
def simulate_command(command):
if simulation_mode:
custom_commands_to_define.add("check-mk-simulation")