Module: check_mk
Branch: master
Commit: 5b02b7724e693098c3e2734198ef1bd1bb257f38
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5b02b7724e6930…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu May 17 08:32:35 2018 +0200
6097 FIX Raw Edition: Fix possible "(null)" output of Check_MK services
The Check_MK service of multiple hosts may terminate without proper error
message resulting just in status output "(null)" in specific situations.
This happened when the precompiled host check files
(var/check_mk/precompiled/[host]) were executed by Nagios using the system wide
Python interpreter instead of the site specific interpreter.
Change-Id: I420d6c0b67e2c52fc3b226cb74c136da5004bd95
---
.werks/6097 | 16 ++++++++++++++++
cmk_base/core_nagios.py | 2 +-
.../skel/etc/nagios/conf.d/check_mk_templates.cfg | 2 +-
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/.werks/6097 b/.werks/6097
new file mode 100644
index 0000000..0f2352f
--- /dev/null
+++ b/.werks/6097
@@ -0,0 +1,16 @@
+Title: Raw Edition: Fix possible "(null)" output of Check_MK services
+Level: 2
+Component: core
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1526538591
+
+The Check_MK service of multiple hosts may terminate without proper error
+message resulting just in status output "(null)" in specific situations.
+
+This happened when the precompiled host check files
+(var/check_mk/precompiled/[host]) were executed by Nagios using the system wide
+Python interpreter instead of the site specific interpreter.
diff --git a/cmk_base/core_nagios.py b/cmk_base/core_nagios.py
index 9cfd5fe..e33c461 100644
--- a/cmk_base/core_nagios.py
+++ b/cmk_base/core_nagios.py
@@ -958,7 +958,7 @@ def _precompile_hostcheck(hostname):
return
output = file(source_filename + ".new", "w")
- output.write("#!/usr/bin/python\n")
+ output.write("#!/usr/bin/env python\n")
output.write("# encoding: utf-8\n\n")
output.write("import sys\n")
diff --git a/omd/packages/check_mk/skel/etc/nagios/conf.d/check_mk_templates.cfg
b/omd/packages/check_mk/skel/etc/nagios/conf.d/check_mk_templates.cfg
index a4a4348..f2fab28 100644
--- a/omd/packages/check_mk/skel/etc/nagios/conf.d/check_mk_templates.cfg
+++ b/omd/packages/check_mk/skel/etc/nagios/conf.d/check_mk_templates.cfg
@@ -294,7 +294,7 @@ define servicedependency {
# Calling check_mk with precompiled checks
define command {
command_name check-mk
- command_line python $USER4$/var/check_mk/precompiled/"$HOSTNAME$"
+ command_line $USER4$/bin/python
$USER4$/var/check_mk/precompiled/"$HOSTNAME$"
}
# Use this variant of if you are working without precompiled