Module: check_mk
Branch: master
Commit: 13ae029a307379eca6d70408b3b1e027b3be8198
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=13ae029a307379…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Dec 18 11:51:54 2013 +0100
FIX Catch exception when check plugins do not return a state
When a broken check plugin does not return a proper state then
Check_MK broke with an exception. This is now better handled.
The check now goes into <i>UNKNOWN</i> state with the message
<tt>Check plugin did not return any result</tt>.
---
.werks/354 | 13 +++++++++++++
ChangeLog | 1 +
modules/check_mk_base.py | 3 +++
3 files changed, 17 insertions(+)
diff --git a/.werks/354 b/.werks/354
new file mode 100644
index 0000000..84ee214
--- /dev/null
+++ b/.werks/354
@@ -0,0 +1,13 @@
+Title: Catch exception when check plugins do not return a state
+Level: 1
+Component: core
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387363842
+Targetversion: future
+
+When a broken check plugin does not return a proper state then
+Check_MK broke with an exception. This is now better handled.
+The check now goes into <i>UNKNOWN</i> state with the message
+<tt>Check plugin did not return any result</tt>.
diff --git a/ChangeLog b/ChangeLog
index adecfc7..1a7a1cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
* 0087 FIX: Fixed possible locking issue when using datasource program with long
output...
* 0313 FIX: Avoid duplicate reading of configuration file on --create-rrd...
* 0379 FIX: check_mk -c: Now also rewrites the location of conf.d directory
+ * 0354 FIX: Catch exception when check plugins do not return a state...
Checks & Agents:
* 0306 esx_vsphere_counters: added missing ramdisk levels sfcbtickets
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 11028ab..bab5a00 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1215,6 +1215,9 @@ def convert_perf_data(p):
def submit_check_result(host, servicedesc, result, sa):
+ if not result:
+ result = 3, "Check plugin did not return any result"
+
if len(result) >= 3:
state, infotext, perfdata = result[:3]
else: