Module: check_mk
Branch: master
Commit: c07cc7e4940622ee1e37ee806a43d28a7e8cb925
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c07cc7e4940622…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jul 31 14:59:52 2013 +0200
Next implementation step of EMC
---
checks/emcvnx_hwstatus | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/checks/emcvnx_hwstatus b/checks/emcvnx_hwstatus
index 7fcd13a..ee7c96a 100644
--- a/checks/emcvnx_hwstatus
+++ b/checks/emcvnx_hwstatus
@@ -50,9 +50,32 @@
# Bus 1 Enclosure 0 Power A State: Present
+# Parse agent output into a dict of the form:
+# parsed = {
+# "0/1" : [
+# "Power A" : "Present",
+# "Power B" : "Present",
+# # ...
+# ]
+# }
+
+def parse_emcvnx_hwstatus(info):
+ parsed = {}
+ for line in info:
+ if line[1] == "Bus" and line[3] == "Enclosure":
+ encid = line[2] + "/" + line[4]
+ enc = []
+ parsed[encid] = enc
+ elif line[6] == "State:":
+ device = line[4] + " " + line[5]
+ state = line[-1]
+
+ return parsed
def inventory_emcvnx_hwstatus(info):
+ parsed = parse_emcvnx_hwstatus(info)
+ import pprint ; pprint.pprint(parsed)
return []
def check_emcvnx_hwstatus(item, _no_params, info):