Module: check_mk
Branch: master
Commit: 652634bca5a1697c799beab75685f747c9eebd6d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=652634bca5a169…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Jan 25 14:16:45 2017 +0100
4303 FIX sap_state: fixed error handling
Change-Id: Icc1ac3cbb3f65cb485058c324873877d4d83d1ca
---
.werks/4303 | 10 ++++++++++
ChangeLog | 1 +
checks/sap_state | 12 +++++++-----
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/.werks/4303 b/.werks/4303
new file mode 100644
index 0000000..7eb31bf
--- /dev/null
+++ b/.werks/4303
@@ -0,0 +1,10 @@
+Title: sap_state: fixed error handling
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i4
+Date: 1485349970
+
+
diff --git a/ChangeLog b/ChangeLog
index f3d732a..164d337 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -69,6 +69,7 @@
* 4301 FIX: winperf_tcp_conn: fixed missing data handling
* 4302 FIX: win_wmi_software: fixed invalid data handling
* 4213 FIX: fjdarye101_syscaps: Fix failing check when using Nagios core
+ * 4303 FIX: sap_state: fixed error handling
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can
now be configured via global settings....
diff --git a/checks/sap_state b/checks/sap_state
index 2afacc8..1b875c1 100644
--- a/checks/sap_state
+++ b/checks/sap_state
@@ -26,8 +26,9 @@
def inventory_sap_state(info):
- for node, value in info:
- yield node, None
+ for line in info:
+ if len(line) == 2:
+ yield line[0], None
def check_sap_state(item, _no_parameters, info):
@@ -37,9 +38,10 @@ def check_sap_state(item, _no_parameters, info):
else:
return 2
- for node, value in info:
- if node == item:
- return value_to_status(value), value
+ for line in info:
+ if line[0] == item:
+ value = line[1]
+ return value_to_status(value), "Status: %s" % value
check_info['sap_state'] = {