Module: check_mk
Branch: master
Commit: 6baf2cbabda4c046d459bb8f4fffc20389ecb623
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6baf2cbabda4c0…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Nov 12 10:18:19 2015 +0100
#2775 FIX omd_status: handle case where status information is incomplete due to missing
cmk version
---
.werks/2775 | 9 +++++++++
ChangeLog | 1 +
checks/omd_status | 8 ++++++--
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/2775 b/.werks/2775
new file mode 100644
index 0000000..b56d5ca
--- /dev/null
+++ b/.werks/2775
@@ -0,0 +1,9 @@
+Title: omd_status: handle case where status information is incomplete due to missing cmk
version
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1447319883
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 9f2be85..1634c35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -72,6 +72,7 @@
* 2761 FIX: check_http: Fixed handling of multiple strings given as "Strings to
expect in server response"
* 2786 FIX: agent_netapp: now able to monitor more than 20 instances of a given type,
e.g. volumes or interfaces...
* 2765 FIX: heartbeat_crm: Fixed issue detecting outdated data with daylight saving
time
+ * 2775 FIX: omd_status: handle case where status information is incomplete due to
missing cmk version
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/omd_status b/checks/omd_status
index 4e47cf9..f2764ec 100644
--- a/checks/omd_status
+++ b/checks/omd_status
@@ -80,9 +80,10 @@ def check_omd_status(item, _no_params, info):
stopped_nodes = 0
for node, services in parsed_site.iteritems():
- if services["overall"] == "stopped":
+ if "overall" in services and services["overall"] ==
"stopped":
stopped_nodes += 1
+
# stopped sites are only CRIT when all are stopped
if stopped_nodes == number_nodes:
state = 2
@@ -94,7 +95,10 @@ def check_omd_status(item, _no_params, info):
node_text = " on %s" % node
else:
node_text = ""
- if services["overall"] == "running":
+ if "overall" not in services:
+ infotext = "defective installation%s" % node_text
+ yield 2, infotext
+ elif services["overall"] == "running":
infotext = "running%s" % node_text
# running sites are always OK
yield 0, infotext