write errors and when enclosure rebuilds
Message-ID: <57aae641.rV0cylrJwnRfaLlB%ab(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 3a9697cf342891d9506d248e9a8c30d0198baaaf
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3a9697cf342891…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Aug 10 10:30:32 2016 +0200
3560 emcvnx_disks: now able to configure states for hard read/write errors and when
enclosure rebuilds
---
.werks/3560 | 9 +++++++++
ChangeLog | 1 +
checks/emcvnx_disks | 20 ++++++++++++--------
web/plugins/wato/check_parameters.py | 32 +++++++++++++++++++++++++++++++-
4 files changed, 53 insertions(+), 9 deletions(-)
diff --git a/.werks/3560 b/.werks/3560
new file mode 100644
index 0000000..3400e28
--- /dev/null
+++ b/.werks/3560
@@ -0,0 +1,9 @@
+Title: emcvnx_disks: now able to configure states for hard read/write errors and when
enclosure rebuilds
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i1
+Date: 1470817777
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index e4e6329..9a65d47 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -123,6 +123,7 @@
* 3725 mssql_instance: Changed MSSQL monitoring to report connection issues with only
one service...
* 3732 esx_vsphere_hostsystem.mem_usage esx_vsphere_hostsystem.mem_usage_cluster:
Providing mem_total as dedicated metric
* 3712 ispro_sensors_temp, ispro_sensors_humid, ispro_sensors_digital: new checks
which monitor Interseptro Pro devices which support the ISPRO-MIB
+ * 3560 emcvnx_disks: now able to configure states for hard read/write errors and when
enclosure rebuilds
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative
to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
* 3074 FIX: windows agent: fixed incorrect values for 32-bit performance counters
diff --git a/checks/emcvnx_disks b/checks/emcvnx_disks
index 92942c2..c717bc3 100644
--- a/checks/emcvnx_disks
+++ b/checks/emcvnx_disks
@@ -134,13 +134,16 @@ def inventory_emcvnx_disks(parsed):
inventory = []
for disk in parsed:
if parsed[disk]["state"] != "Empty":
- inventory.append((disk, None))
+ inventory.append((disk, {}))
return inventory
-def check_emcvnx_disks(item, _no_params, parsed):
+def check_emcvnx_disks(item, params, parsed):
now = time.time()
perfdata = []
+ if params == None: # convert legacy params
+ params = {}
+
if item not in parsed:
return 3, "Enclosure %s not found in agent output" % item
@@ -149,8 +152,8 @@ def check_emcvnx_disks(item, _no_params, parsed):
if diskstate in ["Unbound", "Hot Spare Ready",
"Enabled", "Ready"]:
nagstate = 0
elif diskstate == "Rebuilding":
- nagstate = 1
- message += " (!)"
+ nagstate = params.get("state_rebuilding", 1)
+ message += " %s" % state_markers[nagstate]
else:
nagstate = 2
message += " (!!)"
@@ -160,14 +163,14 @@ def check_emcvnx_disks(item, _no_params, parsed):
read_errors = parsed[item]["Hard Read Errors"]
message += ", Hard Read Errors: %s" % read_errors
if read_errors > 0:
- nagstate = 2
- message += " (!!)"
+ nagstate = params.get("state_read_error", 2)
+ message += " %s" % state_markers[nagstate]
write_errors = parsed[item]["Hard Write Errors"]
message += ", Hard Write Errors: %s" % write_errors
if write_errors > 0:
- nagstate = 2
- message += " (!!)"
+ nagstate = params.get("state_write_error", 2)
+ message += " %s" % state_markers[nagstate]
read_bytes = parsed[item]["Kbytes Read"] * 1024
write_bytes = parsed[item]["Kbytes Written"] * 1024
@@ -190,5 +193,6 @@ check_info['emcvnx_disks'] = {
"inventory_function" : inventory_emcvnx_disks,
"check_function" : check_emcvnx_disks,
"service_description" : "Enclosure %s",
+ "group" : "emcvnx_disks",
"has_perfdata" : True,
}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 5b848f2..573cdc0 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -2310,6 +2310,37 @@ register_check_parameters(
match_type = "dict"
)
+register_check_parameters(
+ subgroup_storage,
+ "emcvnx_disks",
+ _("EMC VNX Enclosures"),
+ Dictionary(
+ elements = [
+ ("state_read_error",
+ MonitoringState(
+ default_value = 2,
+ title = _("State on hard read error")
+ )
+ ),
+ ("state_write_error",
+ MonitoringState(
+ default_value = 2,
+ title = _("State on hard write error")
+ )
+ ),
+ ("state_rebuilding",
+ MonitoringState(
+ default_value = 1,
+ title = _("State when rebuildung enclosure")
+ )
+ ),
+ ]
+ ),
+ TextAscii(
+ title = _("Enclosure ID"),
+ allow_empty = True),
+ match_type = "dict",
+)
#.
@@ -12131,4 +12162,3 @@ register_check_parameters(
TextAscii( title = _("Node ID")),
"first"
)
-