Module: check_mk
Branch: master
Commit: 54a050400583309107b286b5451a3b4780b63421
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=54a05040058330…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri May 25 11:10:38 2012 +0200
FIX: fix configuration of passive checks via custom_checks
---
ChangeLog | 1 +
modules/check_mk.py | 21 +++++++++++----------
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f777f82..fe36100 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
1.2.0b5:
Core:
* FIX: handle UTF-8 encoded binary strings correctly (e.g. in host alias)
+ * FIX: fix configuration of passive checks via custom_checks
WATO:
* Site management: "disabled" only applies to Livestatus now
diff --git a/modules/check_mk.py b/modules/check_mk.py
index e8459e6..7f33d18 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1850,16 +1850,17 @@ define service {
command_name = entry.get("command_name",
"check-mk-custom")
command_line = entry.get("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
+ if 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
custom_commands_to_define.add(command_name)