Module: check_mk
Branch: master
Commit: a8551898ca3f5cebfc0cdb013f197f07e110a56a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a8551898ca3f5c…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Wed Mar 12 15:08:25 2014 +0100
dell_poweredge_mem: new check to monitor memory modules of Dell PowerEdge Servers
---
.werks/591 | 8 ++++
ChangeLog | 1 +
checkman/dell_poweredge_mem | 27 ++++++++++++++
checks/dell_poweredge_mem | 87 +++++++++++++++++++++++++++++++++++++++++++
4 files changed, 123 insertions(+)
diff --git a/.werks/591 b/.werks/591
new file mode 100644
index 0000000..f443b4a
--- /dev/null
+++ b/.werks/591
@@ -0,0 +1,8 @@
+Title: dell_poweredge_mem: new check to monitor memory modules of Dell PowerEdge Servers
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1394633291
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index e71ac16..70fec53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -105,6 +105,7 @@
* 0731 mk_postgres: improved support for versions postgres < 9.2...
* 0588 dell_poweredge_amperage.current, dell_poweredge_amperage.power,
dell_poweredge_cpu, dell_poweredge_status, dell_poweredge_temp: new checks for the Dell
PowerEdge Blade Server
* 0589 brocade_tm: new check monitoring traffic manager statistics for interfaces of
brocade devices
+ * 0591 dell_poweredge_mem: new check to monitor memory modules of Dell PowerEdge
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_poweredge_mem b/checkman/dell_poweredge_mem
new file mode 100644
index 0000000..e22f890
--- /dev/null
+++ b/checkman/dell_poweredge_mem
@@ -0,0 +1,27 @@
+title: Dell PowerEdge Server: State of Memory Modules
+agents: snmp
+catalog: hw/network/dell
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the state of the memory modules of Dell PowerEdge Servers.
+ The state is extracted from the device via SNMP from the parameter
+ {memoryDeviceStatus}.
+
+ The state of the check is {OK} when the device returns a state of {OK}.
+ The state of the cehck is {WARN} when the device returns a state of {other},
+ {unknown} or {nonCritical}. The state of the check is {CRIT} otherwise.
+
+ No limits are set in the check.
+
+ In addition to the state the following information of the memory modules
+ is retrieved and displayed in the check output: size, speed, manufacturer,
+ part number and serial number
+
+item:
+ The name of the location variable configured for the memory module
+
+inventory:
+ All memory module of the device are detected
+
+
diff --git a/checks/dell_poweredge_mem b/checks/dell_poweredge_mem
new file mode 100644
index 0000000..50e9748
--- /dev/null
+++ b/checks/dell_poweredge_mem
@@ -0,0 +1,87 @@
+#!/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_poweredge_mem_info = ( ".1.3.6.1.4.1.674.10892.5.4.1100.50.1", [
+ #"1", # memoryDevicechassisIndex 0
+ #"2", # memoryDeviceIndex 1
+ #"3", # memoryDeviceStateCapabilities
+ #"4", # memoryDeviceStateSettings 0
+ "5", # memoryDeviceStatus 0
+ #"6", # memoryDeviceReading
+ #"7", # memoryDeviceType
+ "8", # memoryDeviceLocationName 1
+ #"10", # memoryDeviceBankLocationName
+ "14", # memoryDeviceSize
+ "15", # memoryDeviceSpeed
+ "21", # memoryDeviceManufacturerName
+ "22", # memoryDevicePartNumberName
+ "23", # memoryDeviceSerialNumberName
+ #"26", # memoryDeviceFQDD
+ ])
+
+dell_poweredge_mem_scan = lambda oid: oid('.1.3.6.1.2.1.1.2.0') ==
".1.3.6.1.4.1.674.10892.5"
+
+def inventory_dell_poweredge_mem(info):
+ inventory = []
+ for line in info:
+ location = line[1]
+ if location != "":
+ inventory.append( ( location, None ) )
+ return inventory
+
+def check_dell_poweredge_mem(item, _no_params, info):
+ di = dict()
+ for status, location, di['Size'], di['Speed'],
di['Manufacturer'], di['PartNumber'], \
+ di['SerialNumber'] in info:
+
+ if item == location:
+ state_table = {
+ "1" : ( "other", 1 ),
+ "2" : ( "unknown", 1 ),
+ "3" : ( "", 0 ),
+ "4" : ( "nonCritical", 1 ),
+ "5" : ( "Critical", 2 ),
+ "6" : ( "NonRecoverable", 2 ),
+ }
+ infotext, state = state_table.get(status, "2")
+ for parameter, value in di.items():
+ infotext += ", %s: %s" % ( parameter, value )
+
+ infotext = re.sub("^, ","", infotext)
+
+ return state, infotext
+
+ return 3, "Memory Device not found"
+
+check_info["dell_poweredge_mem"] = {
+ "check_function" : check_dell_poweredge_mem,
+ "inventory_function" : inventory_dell_poweredge_mem,
+ "service_description" : "%s",
+ "has_perfdata" : False,
+ "snmp_info" : dell_poweredge_mem_info,
+ "snmp_scan" : dell_poweredge_mem_scan,
+}
+