Module: check_mk
Branch: master
Commit: 072f80100d13dd61afc4f07f01e8ee4029bb7171
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=072f80100d13dd…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Dec 9 08:32:10 2015 +0100
When monitoring clustered hosts using Nagios as core, the Check_MK service always
resulted in an UNKNOWN state and this exception:
NameError: global name 'set_use_cachefile' is not defined
Conflicts:
ChangeLog
modules/check_mk.py
---
.werks/2894 | 13 +++++++++++++
ChangeLog | 1 +
modules/check_mk.py | 9 +--------
modules/check_mk_base.py | 5 +++++
4 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/.werks/2894 b/.werks/2894
new file mode 100644
index 0000000..5b96ca9
--- /dev/null
+++ b/.werks/2894
@@ -0,0 +1,13 @@
+Title: Fixed broken cluster checks when using Nagios core
+Level: 2
+Component: core
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1449646012
+
+When monitoring clustered hosts using Nagios as core, the Check_MK service always
+resulted in an UNKNOWN state and this exception:
+
+NameError: global name 'set_use_cachefile' is not defined
diff --git a/ChangeLog b/ChangeLog
index 9be5a43..efcbdfb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,7 @@
* 2764 FIX: Fixed broken SNMP checks in case SNMP check interval is configured for
clusters...
* 2770 FIX: Check_MK is now warning the user about deprecated but configured
checkgroup parameters...
* 2848 FIX: Fixed cleanup of old autocheck files of cluster hosts...
+ * 2894 FIX: Fixed broken cluster checks when using Nagios core...
Checks & Agents:
* 2434 NetApp monitoring: Cluster-Mode is now supported, changes in existing 7Mode
checks...
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 25436c0..a949c75 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1352,12 +1352,6 @@ orig_cluster_max_cachefile_age = None
orig_inventory_max_cachefile_age = None
-def set_use_cachefile(state=True):
- global opt_use_cachefile, orig_opt_use_cachefile
- orig_opt_use_cachefile = opt_use_cachefile
- opt_use_cachefile = state
-
-
def restore_use_cachefile():
global opt_use_cachefile, orig_opt_use_cachefile
if orig_opt_use_cachefile != None:
@@ -4622,8 +4616,7 @@ def do_check_keepalive():
sys.stderr.flush()
cleanup_globals() # Prepare for next check
- global opt_use_cachefile
- opt_use_cachefile = True
+ restore_use_cachefile()
restore_original_agent_caching_usage()
# Check if all global variables are clean, but only in verbose logging mode
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index e25eae0..0fb0f06 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1999,6 +1999,11 @@ def worst_monitoring_state(status_a, status_b):
return max(status_a, status_b)
+def set_use_cachefile(state=True):
+ global opt_use_cachefile, orig_opt_use_cachefile
+ orig_opt_use_cachefile = opt_use_cachefile
+ opt_use_cachefile = state
+
#.
# .--Check helpers-------------------------------------------------------.