Module: check_mk
Branch: master
Commit: bad149cde44c4dedde8e6f90cf1ae8078149ac54
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bad149cde44c4d…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri Aug 2 14:35:49 2013 +0200
emcvnx_hwstatus: added overall status of an enclosure
---
checkman/emcvnx_hwstatus | 3 ++-
checks/emcvnx_hwstatus | 6 +++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/checkman/emcvnx_hwstatus b/checkman/emcvnx_hwstatus
index 4f71531..288e38c 100644
--- a/checkman/emcvnx_hwstatus
+++ b/checkman/emcvnx_hwstatus
@@ -5,7 +5,8 @@ license: GPL
distribution: check_mk
description:
Reports the status of Power Supplies, SPS, SPS Cabeling, LCC, SP, CPU Modules,
- SP I/O Modules and DIMM Modules on EMC storage systems.
+ SP I/O Modules, DIMM Modules and the Overall Status of an Enclosure on EMC
+ storage systems.
Returns {OK} if the agent reports "Present" or "Valid" status and
{CRIT}
on every other status.
diff --git a/checks/emcvnx_hwstatus b/checks/emcvnx_hwstatus
index 7a14337..0364b56 100644
--- a/checks/emcvnx_hwstatus
+++ b/checks/emcvnx_hwstatus
@@ -86,6 +86,10 @@ def parse_emcvnx_hwstatus(info):
encid = line[2] + "/" + line[4]
enc = {}
parsed[encid] = enc
+ if len(line) > 5:
+ enc["Overall Status"] = line[5].replace("*",
"")
+ else:
+ enc["Overall Status"] = "No Errors Reported"
elif len(line) > 2 and line[-2] == "State:":
if line[0] == "SP":
device = line[0] + " " + line[1]
@@ -110,7 +114,7 @@ def check_emcvnx_hwstatus(item, _no_params, info):
enc, device = item.split(" ", 1)
try:
devstate = parse_emcvnx_hwstatus(info)[enc][device]
- if devstate in ("Present", "Valid"):
+ if devstate in ("Present", "Valid", "No Errors
Reported"):
nagstate = 0
else:
nagstate = 2