Module: check_mk
Branch: master
Commit: 778aaf7e4b1859d329e6fe3811c96634258b8f2f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=778aaf7e4b1859…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 17 19:20:55 2013 +0100
FIX local: Catch invalid state codes and map to 3 (UNKNOWN)
If the the state of a line of the <tt>local</tt> section is
not in the allowed range (from <tt>0</tt> to <tt>3</tt>) then
we now assume <tt>3</tt>. Up to now Check_MK ran into an exception.
---
.werks/351 | 12 ++++++++++++
ChangeLog | 1 +
checks/local | 3 +++
3 files changed, 16 insertions(+)
diff --git a/.werks/351 b/.werks/351
new file mode 100644
index 0000000..7f435f8
--- /dev/null
+++ b/.werks/351
@@ -0,0 +1,12 @@
+Title: local: Catch invalid state codes and map to 3 (UNKNOWN)
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387304385
+Targetversion: future
+
+If the the state of a line of the <tt>local</tt> section is
+not in the allowed range (from <tt>0</tt> to <tt>3</tt>) then
+we now assume <tt>3</tt>. Up to now Check_MK ran into an exception.
diff --git a/ChangeLog b/ChangeLog
index 56b1574..4d07915 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -59,6 +59,7 @@
* 0110 FIX: cisco_fru_power: Prevent inventory for not available FRUs
* 0350 FIX: nfsmounts: correctly handle mount points with spaces...
* 0387 FIX: df*: Negative filesystem space levels get a more clear text in check
output...
+ * 0351 FIX: local: Catch invalid state codes and map to 3 (UNKNOWN)...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/checks/local b/checks/local
index 605bd9a..0d910c5 100644
--- a/checks/local
+++ b/checks/local
@@ -116,6 +116,9 @@ def check_local(item, params, info):
output = ", ".join(texts)
else:
state = int(statechar)
+ if state not in range(0, 4):
+ output += ", local check has sent invalid state %d" %
state
+ state = 3
return (state, output, perfdata)
return (3, "Check output not found in local checks")