[checkmk-commits] Check_MK Git: check_mk: #1175 dell_idrac_disks: New Check for Harddisks using Dell iDrac

Bastian Kuhn bk at mathias-kettner.de
Tue Aug 12 17:22:49 CEST 2014


Module: check_mk
Branch: master
Commit: 387ec1ff6a43dd7f04b3dafc1800b2606672bd17
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=387ec1ff6a43dd7f04b3dafc1800b2606672bd17

Author: Bastian Kuhn <bk at mathias-kettner.de>
Date:   Tue Aug 12 17:22:41 2014 +0200

#1175 dell_idrac_disks: New Check for Harddisks using Dell iDrac

---

 .werks/1175               |    9 ++++
 ChangeLog                 |    2 +-
 checkman/dell_idrac_disks |   17 +++++++
 checks/dell_idrac_disks   |  123 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 150 insertions(+), 1 deletion(-)

diff --git a/.werks/1175 b/.werks/1175
new file mode 100644
index 0000000..d4ab557
--- /dev/null
+++ b/.werks/1175
@@ -0,0 +1,9 @@
+Title: dell_idrac_disks: New Check for Harddisks using Dell iDrac
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1407856904
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 6be01f0..1a8592e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,7 @@
     * 1173 cisco_secure: Check creates now a summary instead one service by port...
             NOTE: Please refer to the migration notes!
     * 1174 rms200_temp: New Temperature check for RMS200 Devices
+    * 1175 dell_idrac_disks: New Check for Harddisks using Dell iDrac
     * 1051 FIX: tcp_conn_stats: fix missing performance data...
     * 1142 FIX: winperf_ts_sessions: fix computation, check has never really worked
     * 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
@@ -37,7 +38,6 @@
     * 1154 FIX: Availability: Fixed unwanted redirect to edit annotation page after editing availability options...
 
     WATO:
-    * 1095 New WATO Web-API: Now able to manage hosts via web automation calls
     * 1096 New WATO webservices: manage hosts via webinterface...
     * 1064 FIX: Fixed rare issue with WATO communication in distributed setups (different OS versions)...
     * 1089 FIX: Snapshot restore: fixed exception during exception handling......
diff --git a/checkman/dell_idrac_disks b/checkman/dell_idrac_disks
new file mode 100644
index 0000000..29b3ef9
--- /dev/null
+++ b/checkman/dell_idrac_disks
@@ -0,0 +1,17 @@
+title: Dell iDrac: Disks
+agents: snmp
+catalog: hw/server/dell
+license: GPL
+distribution: check_mk
+description:
+ This checks connects to a Dell iDrac and monitors the health and current 
+ 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.
+
+item:
+ The compination of EnclosureID, Channel and TargetID seperated by colums
+
+inventory:
+ One check is created for each Disk
+
diff --git a/checks/dell_idrac_disks b/checks/dell_idrac_disks
new file mode 100644
index 0000000..5c40f0a
--- /dev/null
+++ b/checks/dell_idrac_disks
@@ -0,0 +1,123 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# |             ____ _               _        __  __ _  __           |
+# |            / ___| |__   ___  ___| | __   |  \/  | |/ /           |
+# |           | |   | '_ \ / _ \/ __| |/ /   | |\/| | ' /            |
+# |           | |___| | | |  __/ (__|   <    | |  | | . \            |
+# |            \____|_| |_|\___|\___|_|\_\___|_|  |_|_|\_\           |
+# |                                                                  |
+# | Copyright Mathias Kettner 2013             mk at mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software;  you can redistribute it and/or modify it
+# under the  terms of the  GNU General Public License  as published by
+# the Free Software Foundation in version 2.  check_mk is  distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY;  with-
+# out even the implied warranty of  MERCHANTABILITY  or  FITNESS FOR A
+# PARTICULAR PURPOSE. See the  GNU General Public License for more de-
+# ails.  You should have  received  a copy of the  GNU  General Public
+# License along with GNU Make; see the file  COPYING.  If  not,  write
+# to the Free Software Foundation, Inc., 51 Franklin St,  Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+def inventory_dell_idrac_disks(info):
+    inventory = []
+    for line in info:
+        inventory.append(( line[0], None ))
+    return inventory
+
+def check_dell_idrac_disks(item, _no_params, info):
+    diskStates  = {
+        1 : "unkown",
+        2 : "ready",
+        3 : "online",
+        4 : "foreign",
+        5 : "offline",
+        6 : "blocked",
+        7 : "failed",
+        8 : "non-raid",
+        9 : "removed",
+    }
+
+    componentStates = {
+        1 : "Other",
+        2 : "Unknown",
+        3 : "OK",
+        4 : "Non-critical",
+        5 : "Critical",
+        6 : "Non-recoverable"
+    }
+
+    sparestates = {
+        1 : "not a Spare",
+        2 : "dedicated Hotspare",
+        3 : "global Hotspare",
+    }
+    for diskname, diskState, capacityMB, spareState, componentState, smartAlert, displayName in info:
+        if diskname == item:
+            state = 0
+            infotexts = []
+
+            # Component State
+            componentState = int(componentState)
+            infotext = "State: " + componentStates[componentState]
+            if componentState in [ 5, 6 ]:
+                state = 2
+                infotexts.append(infotext+"(!!)")
+            elif componentState in [ 1, 2, 4 ]:
+                state = max(state, 1)
+                infotexts.append(infotext+"(!)")
+            
+            # Smart Alert
+            if smartAlert != '0':
+                infotexts.append("Smart Alert on Disk(!!)")
+
+            # Disk State
+            diskState = int(diskState)
+            infotext = "Disk State: " + diskStates[diskState]
+            label = ""
+            show = False
+            if diskState in [ 1, 5, 6, 7, 9 ]:
+                state = 2
+                label = "(!!)"
+                show = True
+            elif diskState in [ 4, 8 ]:
+                state = max(state, 1)
+                label = "(!)"
+                show = True
+            if show:
+                infotexts.append(infotext+label)
+
+            spareState = int(spareState)
+            if spareState != 1:
+                infotexts.append('Spare State: ' + sparestates[spareState] )
+
+            # Capacity
+            infotexts.append("Size: " + get_bytes_human_readable(int(capacityMB) * 1024 * 1024 ))
+            
+            # Display Name
+            infotexts.append(displayName)
+
+            return state, ", ".join(infotexts)
+    return 3, "Disk not found in SNMP Output"
+
+check_info["dell_idrac_disks"] = {
+    "check_function"        : check_dell_idrac_disks,
+    "inventory_function"    : inventory_dell_idrac_disks,
+    "service_description"   : "Disk %s",
+    "snmp_scan_function"    : lambda oid: oid('.1.3.6.1.2.1.1.2.0') == ".1.3.6.1.4.1.674.10892.5",
+    "snmp_info"             : (".1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1", [
+                                                                            2, # physicalDiskName
+                                                                            4, # physicalDiskState
+                                                                            11, # physicalDiskCapacityInMB
+                                                                            22, # physicalDiskSpareState
+                                                                            24, # physicalDiskComponentStatus
+                                                                            31, # physicalDiskSmartAlertIndication
+                                                                            55, # physicalDiskDisplayName
+                                                                         ]),
+}
+



More information about the checkmk-commits mailing list