Module: check_mk
Branch: master
Commit: 856ba26abdf898a200ef126a5f2bdbda4293ad11
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=856ba26abdf898…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Thu Jun 30 11:25:34 2016 +0200
3150 FIX fixed helpers failing to start and high cpu load when an unparsable local check is installed
When python fails to parse a check file (local or shipped), the check_mk helpers would produce an
erro message and exit. check_mk would then restart the helper, repeating the process infinitely
which left check_mk in a non-working state, causing high cpu load and quickly growing the cmc.log.
This only occurs when installing syntactically broken checks so most users shouldn't be affected.
---
.werks/3150 | 14 ++++++++++++++
ChangeLog | 1 +
modules/check_mk.py | 7 ++++++-
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/.werks/3150 b/.werks/3150
new file mode 100644
index 0000000..0ccf0b0
--- /dev/null
+++ b/.werks/3150
@@ -0,0 +1,14 @@
+Title: fixed helpers failing to start and high cpu load when an unparsable local check is installed
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1467278454
+
+When python fails to parse a check file (local or shipped), the check_mk helpers would produce an
+erro message and exit. check_mk would then restart the helper, repeating the process infinitely
+which left check_mk in a non-working state, causing high cpu load and quickly growing the cmc.log.
+
+This only occurs when installing syntactically broken checks so most users shouldn't be affected.
diff --git a/ChangeLog b/ChangeLog
index 9c4eef9..1513450 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -289,6 +289,7 @@
* 3655 FIX: if64adm: Can now be used with OID range limits
* 3685 FIX: brocade_fcport: fixed unknown state texts
* 3686 FIX: hp_proliant_temp: fixed wrong device thresholds handling. If no thresholds available the device reports -99
+ * 3150 FIX: fixed helpers failing to start and high cpu load when an unparsable local check is installed...
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 32b9715..6a61d27 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -429,7 +429,12 @@ def load_checks():
sys.stderr.write("Error in plugin file %s: %s\n" % (f, e))
if opt_debug:
raise
- sys.exit(5)
+ # If we exit here, from a check_mk helper, check_mk will just
+ # try to restart the helper. This causes a tight loop of helper
+ # crashing and helper restarting that spams the log file and
+ # causes high cpu load which is a bit pointless because an
+ # invalid plugin file isn't going to fix itself
+ #sys.exit(5)
for varname, value in globals().iteritems():
if varname[0] != '_' \