Module: check_mk
Branch: master
Commit: 1801656f875ae6e6de8eb6547cae292255bfbfd9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1801656f875ae6…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Mar 4 09:12:12 2016 +0100
3257 dell_idrac_virtdisks: new check which monitors the virtual disks of a Dell IDrac
Device
---
.werks/3257 | 9 +++++
ChangeLog | 1 +
checkman/dell_idrac_virtdisks | 22 +++++++++++
checks/dell_idrac_virtdisks | 86 +++++++++++++++++++++++++++++++++++++++++
4 files changed, 118 insertions(+)
diff --git a/.werks/3257 b/.werks/3257
new file mode 100644
index 0000000..0515549
--- /dev/null
+++ b/.werks/3257
@@ -0,0 +1,9 @@
+Title: dell_idrac_virtdisks: new check which monitors the virtual disks of a Dell IDrac
Device
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.9i1
+Date: 1457079074
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index d85ebfc..2bdc503 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,7 @@
* 3191 cisco_redundancy: new check which monitors the status of the redundant unit of
Cisco devices supporting the CISCO-RF-MIB
* 3083 mk_jolokia: The plugin can now be configured with a service url to treat the
jolokia server as a jmx proxy
* 3085 fortigate_signatures: new check to monitor av and ips signatures on fortigate
firewalls...
+ * 3257 dell_idrac_virtdisks: new check which monitors the virtual disks of a Dell
IDrac Device
* 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/checkman/dell_idrac_virtdisks b/checkman/dell_idrac_virtdisks
new file mode 100644
index 0000000..dc39144
--- /dev/null
+++ b/checkman/dell_idrac_virtdisks
@@ -0,0 +1,22 @@
+title: Dell iDrac: Virtual Disks
+agents: snmp
+catalog: hw/server/dell
+license: GPL
+distribution: check_mk
+description:
+ This checks monitors the disk and component status of a Dell iDrac and
+ gives information about the number of physical disks which can be lost
+ before the$ virtual disk loses its redundancy.
+
+ The check goes CRIT if the disk fails or is degraded or if the component
+ reports critical or non-recoverable.
+ The check changes to WARN if the disk state is unknown or if the component
+ is unknown or non-critical.
+ Otherwise the check is OK.
+
+item:
+ The virtual disk name.
+
+inventory:
+ One check is created for each virtual disk.
+
diff --git a/checks/dell_idrac_virtdisks b/checks/dell_idrac_virtdisks
new file mode 100644
index 0000000..39f76f6
--- /dev/null
+++ b/checks/dell_idrac_virtdisks
@@ -0,0 +1,86 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 mk(a)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-
+# tails. 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.
+
+
+# .1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.2.1 System --> IDRAC-MIB::virtualDiskName.1
+# .1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.2.2 Oracle --> IDRAC-MIB::virtualDiskName.2
+# .1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.2.3 Backup --> IDRAC-MIB::virtualDiskName.3
+# .1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.4.1 2 --> IDRAC-MIB::virtualDiskState.1
+# .1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.4.2 2 --> IDRAC-MIB::virtualDiskState.2
+# .1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.4.3 2 --> IDRAC-MIB::virtualDiskState.3
+# .1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.20.1 3 -->
IDRAC-MIB::virtualDiskComponentStatus.1
+# .1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.20.2 3 -->
IDRAC-MIB::virtualDiskComponentStatus.2
+# .1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.20.3 3 -->
IDRAC-MIB::virtualDiskComponentStatus.3
+# .1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.34.1 1 -->
IDRAC-MIB::virtualDiskRemainingRedundancy.1
+# .1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.34.2 1 -->
IDRAC-MIB::virtualDiskRemainingRedundancy.2
+# .1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.34.3 1 -->
IDRAC-MIB::virtualDiskRemainingRedundancy.3
+
+
+def inventory_dell_idrac_virtdisks(info):
+ return [ (line[0], None) for line in info ]
+
+
+def check_dell_idrac_virtdisks(item, _no_params, info):
+ map_states = {
+ "disk" : {
+ "1" : (1, "unknown"),
+ "2" : (0, "online"),
+ "3" : (2, "failed"),
+ "4" : (2, "degraded"),
+ },
+ "component" : {
+ "1" : (0, "other"),
+ "2" : (1, "unknown"),
+ "3" : (0, "OK"),
+ "4" : (1, "non-critical"),
+ "5" : (2, "critical"),
+ "6" : (2, "non-recoverable"),
+ },
+ }
+ for name, disk_state, component_state, redundancy in info:
+ if item == name:
+ for what, what_key in [
+ (disk_state, "Disk"),
+ (component_state, "Component")]:
+ state, state_readable = map_states[what_key.lower()][what]
+ yield state, "%s status: %s" % (what_key, state_readable)
+
+ yield 0, "Remaining redundancy: %s physical disk(s)" % redundancy
+
+
+check_info["dell_idrac_virtdisks"] = {
+ "check_function" : check_dell_idrac_virtdisks,
+ "inventory_function" : inventory_dell_idrac_virtdisks,
+ "service_description" : "Virtual 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.140.1.1", [
+ "2", # virtualDiskName
+ "4", # virtualDiskState
+ "20", # virtualComponentStatus
+ "34", # virtualDiskRemainingRedundancy
+ ]),
+}
+