Module: check_mk
Branch: master
Commit: e90ff6446582aa723cdc1d3911dc5e09b7fa63d7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e90ff6446582aa…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Thu Mar 20 23:17:04 2014 +0100
dell_chassis_slots: new check to monitor the status of the blade slots of the Dell
Poweredge Blade Servers
---
.werks/597 | 8 +++++
ChangeLog | 1 +
checkman/dell_chassis_slots | 22 +++++++++++++
checks/dell_chassis_slots | 73 +++++++++++++++++++++++++++++++++++++++++++
4 files changed, 104 insertions(+)
diff --git a/.werks/597 b/.werks/597
new file mode 100644
index 0000000..844d207
--- /dev/null
+++ b/.werks/597
@@ -0,0 +1,8 @@
+Title: dell_chassis_slots: new check to monitor the status of the blade slots of the Dell
Poweredge Blade Servers
+Level: 2
+Component: checks
+Version: 1.2.5i1
+Date: 1395353802
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index aa14644..7d79fd1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -120,6 +120,7 @@
* 0144 enterasys_cpu_util enterasys_powersupply: New Checks for CPU Utilization and
Power Supplies on enterasys switches
* 0595 dell_chassis_power, dell_chassis_powersupplies: new checks for Dell Poweredge
Chassis Ppower consumption...
* 0596 dell_chassis_status, dell_chassis_temp, dell_chassis_kvm, dell_chassis_io,
dell_chassis_fans: new checks to monitor the overall status of various sections of the
Dell Poweredge Chassis via CMC
+ * 0597 dell_chassis_slots: new check to monitor the status of the blade slots of the
Dell Poweredge Blade Servers
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/dell_chassis_slots b/checkman/dell_chassis_slots
new file mode 100644
index 0000000..a382cab
--- /dev/null
+++ b/checkman/dell_chassis_slots
@@ -0,0 +1,22 @@
+title: Dell PowerEdge Chassis: State of the Blade Slots
+agents: snmp
+catalog: hw/server/dell
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the blade slots of the chassis of Dell PowerEdge Servers.
+
+ The check returns {OK} when a slot is in the {basic} state. It returns {WARN}
+ otherwise.
+
+ No limits are set in the check.
+
+ In addition to the state, the check displays the following other parameters
+ of the server: drsServerServiceTag, drsServerSlotName
+
+item:
+ The id of the slot
+
+inventory:
+ All slots where the state is not "absent".
+
diff --git a/checks/dell_chassis_slots b/checks/dell_chassis_slots
new file mode 100644
index 0000000..a3a634a
--- /dev/null
+++ b/checks/dell_chassis_slots
@@ -0,0 +1,73 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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-
+# 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.
+
+dell_chassis_slots_info = ( ".1.3.6.1.4.1.674.10892.2.5.1.1", [
+ "1", # drsServerIndex
+ "2", # drsServerMonitoringCapable
+ "3", # drsServerServiceTag
+ "4", # drsServerSlotName
+ ])
+
+dell_chassis_slots_scan = lambda oid: oid('.1.3.6.1.2.1.1.2.0') ==
".1.3.6.1.4.1.674.10892.2"
+
+def inventory_dell_chassis_slots(info):
+ inventory = []
+ for line in info:
+ index = line[0]
+ if saveint(index) in ( 1, 2, 3, 4, 5, 6, 7, 8, 9 ):
+ index = "0"+index
+ if line[1] != "1" and line[3] != "N/A":
+ inventory.append( ( index, None ) )
+ return inventory
+
+def check_dell_chassis_slots(item, _no_params, info):
+ for index, status, service_tag, name in info:
+ if saveint(index) in ( 1, 2, 3, 4, 5, 6, 7, 8, 9 ):
+ index = "0"+index
+ if item == index:
+ #absent = 1,none = 2,basic = 3,off = 4,
+ state_table = {
+ "1" : ( "absent", 0 ),
+ "2" : ( "none", 1 ),
+ "3" : ( "basic", 0 ),
+ "4" : ( "off", 1 ),
+ }
+ state_txt, state = state_table.get(status, ("unknown state, ", 3
))
+ infotext = "Status: %s, Name: %s, ServiceTag: %s" % ( state_txt,
name, service_tag )
+
+ return state, infotext
+
+ return 3, "unknown slot"
+
+check_info["dell_chassis_slots"] = {
+ "check_function" : check_dell_chassis_slots,
+ "inventory_function" : inventory_dell_chassis_slots,
+ "service_description" : "Slot %s",
+ "has_perfdata" : False,
+ "snmp_info" : dell_chassis_slots_info,
+ "snmp_scan" : dell_chassis_slots_scan,
+}
+