Module: check_mk
Branch: master
Commit: a62ea3c72abafe82da181b827a8b04693bace647
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a62ea3c72abafeā¦
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Sep 22 10:49:01 2017 +0200
5309 dell_idrac_disks: Added disk power status
Change-Id: I22955b896ff189b7196edc9b58785f242a7d22a1
---
.werks/5309 | 10 ++++++++++
checkman/dell_idrac_disks | 3 +++
checks/dell_idrac_disks | 17 ++++++++++++++++-
3 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/.werks/5309 b/.werks/5309
new file mode 100644
index 0000000..673f0f5
--- /dev/null
+++ b/.werks/5309
@@ -0,0 +1,10 @@
+Title: dell_idrac_disks: Added disk power status
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1506070031
+Class: feature
+
+
diff --git a/checkman/dell_idrac_disks b/checkman/dell_idrac_disks
index e7ae819..88b8f00 100644
--- a/checkman/dell_idrac_disks
+++ b/checkman/dell_idrac_disks
@@ -8,6 +8,9 @@ description:
Status of Hardisks attached to server. Currently tested with iDrac V7.
The check returns a {CRIT} in case of an error state reported
by the device. The check also reports Size, SMART Errors and Spare state for each disk.
+ Moreover the disk power status is monitored. The check goes WARN if this status
+ is REBUILDING, data-erased or COPY-BACK, it's OK in case of no-operation, otherwise
+ UNKNOWN.
item:
The compination of EnclosureID, Channel and TargetID seperated by colums
diff --git a/checks/dell_idrac_disks b/checks/dell_idrac_disks
index 27879f1..2a1fae1 100644
--- a/checks/dell_idrac_disks
+++ b/checks/dell_idrac_disks
@@ -40,6 +40,8 @@
# .1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.55.1 Disk 0 in Backplane 1 of Integrated RAID
Controller 1 --> IDRAC-MIB::physicalDiskDisplayName.1
# .1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.55.2 Disk 1 in Backplane 1 of Integrated RAID
Controller 1 --> IDRAC-MIB::physicalDiskDisplayName.2
+# 2017-08-04: M. Hoffmann (MPI of Biochemistry): added rebuild/copyback information
+
def inventory_dell_idrac_disks(info):
inventory = []
@@ -69,14 +71,22 @@ def check_dell_idrac_disks(item, _no_params, info):
"5" : (2, "critical"),
"6" : (1, "non-recoverable"),
},
+ "diskpower_states" : {
+ "1" : (0, "no-operation"),
+ "2" : (1, "REBUILDING"),
+ "3" : (1, "data-erased"),
+ "4" : (1, "COPY-BACK"),
+ },
}
+
map_spare_state_info = {
"1" : "not a spare",
"2" : "dedicated hotspare",
"3" : "global hotspare",
}
+
for disk_name, disk_state, capacity_MB, spare_state, \
- component_state, smart_alert, display_name in info:
+ component_state, smart_alert, diskpower_state, display_name in info:
if disk_name == item:
yield 0, "[%s] Size: %s" % \
(display_name, get_bytes_human_readable(int(capacity_MB) * 1024 * 1024))
@@ -93,6 +103,10 @@ def check_dell_idrac_disks(item, _no_params, info):
if spare_state != "1":
yield 0, map_spare_state_info[spare_state]
+ if diskpower_state != "1":
+ state, state_readable =
map_states["diskpower_states"][diskpower_state]
+ yield state, "%s" % (state_readable)
+
check_info["dell_idrac_disks"] = {
"check_function" : check_dell_idrac_disks,
@@ -106,6 +120,7 @@ check_info["dell_idrac_disks"] = {
"22", # physicalDiskSpareState
"24", # physicalDiskComponentStatus
"31", # physicalDiskSmartAlertIndication
+ "50", # physicalDiskPowerState
"55", # physicalDiskDisplayName
]),
}