Module: check_mk
Branch: master
Commit: 5d82b71beeb590ade4152ffe7a58dce9d9fc9ab7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5d82b71beeb590…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Dec 12 14:45:32 2016 +0100
4160 FIX emcvnx_info: fixed data handling, now detects errors
Change-Id: I2a4f9071d2b9de303692f4ea0e86ccc9efe0b5bb
---
.werks/4160 | 10 ++++++++++
ChangeLog | 1 +
checks/emcvnx_info | 14 +++++++-------
3 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/.werks/4160 b/.werks/4160
new file mode 100644
index 0000000..9a4d708
--- /dev/null
+++ b/.werks/4160
@@ -0,0 +1,10 @@
+Title: emcvnx_info: fixed data handling, now detects errors
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i3
+Date: 1481550183
+
+
diff --git a/ChangeLog b/ChangeLog
index a988714..f2ed387 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -60,6 +60,7 @@
* 4101 FIX: citrix_sessions: Output error message in case of missing session
information....
* 4159 FIX: mem.win: fixed KeyError
* 4102 FIX: logwatch: Fixed crash due to non-existant logfile...
+ * 4160 FIX: emcvnx_info: fixed data handling, now detects errors
Multisite:
* 4070 Added a painter for the service check period
diff --git a/checks/emcvnx_info b/checks/emcvnx_info
index 7422005..9123997 100644
--- a/checks/emcvnx_info
+++ b/checks/emcvnx_info
@@ -66,17 +66,17 @@
def inventory_emcvnx_info(info):
- return [ (None, None) ]
+ if info:
+ return [ (None, None) ]
def check_emcvnx_info(item, _no_params, info):
- message = ""
for line in info:
- if len(line) > 1 and line[0] in ("Revision:", "Model:",
"Serial"):
- if message != "":
- message += ", "
- message += " ".join(line)
- return 0, message
+ if len(line) > 1:
+ state = 0
+ if line[0] == "Error":
+ state = 2
+ yield state, " ".join(line)
check_info['emcvnx_info'] = {