Module: check_mk
Branch: master
Commit: 53f4a90bb33ad70d239281a7e6bd28cebca14f5a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=53f4a90bb33ad7…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Jun 1 08:25:09 2015 +0200
#1252 hitachi_hus_status: New check to monitor drive status on Hitachi Hus Systems
---
.werks/1252 | 9 +++++++++
ChangeLog | 1 +
checkman/hitachi_hus_status | 12 ++++++++++++
checks/hitachi_hus_status | 31 +++++++++++++++----------------
4 files changed, 37 insertions(+), 16 deletions(-)
diff --git a/.werks/1252 b/.werks/1252
new file mode 100644
index 0000000..e349d1a
--- /dev/null
+++ b/.werks/1252
@@ -0,0 +1,9 @@
+Title: hitachi_hus_status: New check to monitor drive status on Hitachi Hus Systems
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1433139880
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 1b55da4..1025d35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -198,6 +198,7 @@
* 1251 lvm_pvs, lvm_vgs: New Checks for LVM volume groups and physical volumes...
* 2280 agent_vsphere: now provides more information if the login attempt fails...
* 2116 bluenet_sensor, bluenet_sensor.hum: new checks to monitor temperature and
humidity of Bachmann Bluenet PDUs
+ * 1252 hitachi_hus_status: New check to monitor drive status on Hitachi Hus Systems
* 1457 FIX: logins: new check renamed from "users" check...
NOTE: Please refer to the migration notes!
* 1762 FIX: lnx_thermal: Now ignoring trip points with level 0...
diff --git a/checkman/hitachi_hus_status b/checkman/hitachi_hus_status
new file mode 100644
index 0000000..6cac80e
--- /dev/null
+++ b/checkman/hitachi_hus_status
@@ -0,0 +1,12 @@
+title: Hitachi HUS: Global Drive Status
+agents: snmp
+catalog: hw/storagehw/hitachi
+license: GPL
+distribution: check_mk
+description:
+
+ This Check monitors the total state of disks (also shown as error code on the device
display).
+ It reports the global state as number and detailed information with the name of affected
components.
+
+inventory:
+ On service will be created
diff --git a/checks/hitachi_hus_status b/checks/hitachi_hus_status
index 8763928..ef387d6 100644
--- a/checks/hitachi_hus_status
+++ b/checks/hitachi_hus_status
@@ -25,10 +25,10 @@
# Boston, MA 02110-1301 USA.
-def inventory_hitatchi_hus_status(info):
+def inventory_hitatchi_hus_status2(info):
return [ (None, None)]
-def check_hitatchi_hus_status(_no_item, _no_params, info):
+def check_hitatchi_hus_status2(_no_item, _no_params, info):
status_values = {
0 : ( 0, "Array in normal status" ),
1 : ( 2, "Drive blocked" ),
@@ -45,23 +45,22 @@ def check_hitatchi_hus_status(_no_item, _no_params, info):
131072 : ( 2, "Power supply failure" ),
1048576 : ( 1, "Fan alarm" ),
4194304 : ( 2, "Host I/O module failure" ),
- 838608 : ( 2, "Management module failure" ),
+ 8388608 : ( 2, "Management module failure" ),
16777216 : ( 2, "Host connector alarm" ),
- 268436456 : ( 2, "Host connector alarm" ),
+ 268435456 : ( 2, "Host connector alarm" ),
}
+ if int(info[0][0]) == 0:
+ yield 0, "Array in normal status"
+ else:
+ yield 0, "Errorcode: %s" % info[0][0]
+ for status, output in status_values.items():
+ state, message = output
+ if status & int(info[0][0]):
+ yield state, message
- for status, output in status_values.items():
- state, message = output
- found_error = False
- if status & int(info[0][0]):
- found_error = True
- yield state, message
- if found_error:
- yield 0, "Array in normal status"
-
-check_info["hitatchi_hus_status"] = {
- "check_function" : check_hitatchi_hus_status,
- "inventory_function" : inventory_hitatchi_hus_status,
+check_info["hitatchi_hus_status2"] = {
+ "check_function" : check_hitatchi_hus_status2,
+ "inventory_function" : inventory_hitatchi_hus_status2,
"service_description" : "Status",
"snmp_info" : (".1.3.6.1.4.1.116.5.11.1.2.2", [ 1
]),
"snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.116"),