Module: check_mk
Branch: master
Commit: db1d52f6ca5e501d4490bbbcef88163464228595
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=db1d52f6ca5e50…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Fri Jun 12 17:49:46 2015 +0200
#2122 datapower_fan: new check to monitor fan status of IBM Datapower Gateways
---
.werks/2122 | 9 +++++
ChangeLog | 1 +
checkman/datapower_fan | 22 ++++++++++++
checks/datapower_fan | 89 ++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 121 insertions(+)
diff --git a/.werks/2122 b/.werks/2122
new file mode 100644
index 0000000..80e78b4
--- /dev/null
+++ b/.werks/2122
@@ -0,0 +1,9 @@
+Title: datapower_fan: new check to monitor fan status of IBM Datapower Gateways
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i2
+Date: 1434124161
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 701baa1..3ab1d1b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,7 @@
* 2220 pfsense_counter: New check to monitor several global packet rates on pfSense
firewalls
* 2120 datapower_cpu, datapower_mem: new checks to monitor CPU and memory and IBMs
Datapower Gateways
* 2121 datapower_temp: new check to monitor temperature sensors of IBMs Datapower
Gateways
+ * 2122 datapower_fan: new check to monitor fan status of IBM Datapower Gateways
* 2323 FIX: df: Fix new graphs for all filesystem checks in case of existing inode
information
* 2305 FIX: agent_vsphere, esx_vsphere_sensors: now able to handle sensor names with
semicolon...
* 2118 FIX: aix_sap_processlist: agent plugin now is more general to deal with
various AIX versions...
diff --git a/checkman/datapower_fan b/checkman/datapower_fan
new file mode 100644
index 0000000..1ae8724
--- /dev/null
+++ b/checkman/datapower_fan
@@ -0,0 +1,22 @@
+title: IBM Datapower Fans
+agents: snmp
+catalog: hw/network/ibm
+license: GPL
+distribution: check_mk
+description:
+
+ This check monitors the fans of IBMs Datapower Gateways supporting the
+ DATAPOWER-STATUS-MIB.
+
+ It reports the fan speed in rpm, and the state of the fan extracted from
+ the device. The state of the service is derived accordingly.
+
+ No limits can be defined for this check,
+
+inventory:
+ On each gateway one service is created for each fan found.
+
+item:
+ The item name is derived from the extracted ID number of the fan and
+ a mapping between IDs and fan locations hardcoded in the check and
+ taken from the DATAPOWER-STATUS-MIB.
diff --git a/checks/datapower_fan b/checks/datapower_fan
new file mode 100644
index 0000000..dc3dcf9
--- /dev/null
+++ b/checks/datapower_fan
@@ -0,0 +1,89 @@
+#!/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-
+# 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.
+#
+
+datapower_fan_ids = {
+ "1": "CPU 1",
+ "2": "CPU 2",
+ "3": "Chassis 1",
+ "4": "Chassis 2",
+ "5": "Chassis 3",
+ "6": "Chassis 4",
+ "7": "Chassis 5",
+ "8": "Chassis 6",
+ "9": "Chassis 7",
+ "10": "Chassis 8",
+ "11": "Tray 1 Fan 1",
+ "12": "Tray 1 Fan 2",
+ "13": "Tray 1 Fan 3",
+ "14": "Tray 1 Fan 4",
+ "15": "Tray 2 Fan 1",
+ "16": "Tray 2 Fan 2",
+ "17": "Tray 2 Fan 3",
+ "18": "Tray 2 Fan 4",
+ "19": "Tray 3 Fan 1",
+ "20": "Tray 3 Fan 2",
+ "21": "Tray 3 Fan 3",
+ "22": "Tray 3 Fan 4",
+ "23": "Hard Disk Tray Fan 1",
+ "24": "Hard Disk Tray Fan 2",
+}
+
+def inventory_datapower_fan(info):
+ for fan_id, speed, status in info:
+ yield datapower_fan_ids[fan_id], None
+
+def check_datapower_fan(item, _no_params, info):
+ datapower_fan_status = {
+ "1": (2, "reached lower non-recoverable limit: "),
+ "2": (2, "reached lower critical limit: "),
+ "3": (1, "reached lower non-critical limit: "),
+ "4": (0, ""), # OK
+ "5": (1, "reached upper non-critical limit: "),
+ "6": (2, "reached upper critical limit: "),
+ "7": (2, "reached upper non-recoverable limit: "),
+ "8": (2, "failure, "),
+ "9": (2, "no reading, "),
+ "10": (1, "invalid, "),
+ }
+ for fan_id, speed, status in info:
+ if item == datapower_fan_ids[fan_id]:
+ state, state_txt = datapower_fan_status[status]
+ infotext = "%s%s rpm" % (state_txt, speed)
+ return state, infotext
+
+
+check_info["datapower_fan"] = {
+ "inventory_function" : inventory_datapower_fan,
+ "check_function" : check_datapower_fan,
+ "service_description" : "Fan %s",
+ "snmp_info" : (".1.3.6.1.4.1.14685.3.1.97.1", [
+ 1, # dpStatusEnvironmentalFanSensorsFanID
+ 2, # dpStatusEnvironmentalFanSensorsFanSpeed
+ 4, # dpStatusEnvironmentalFanSensorsReadingStatus
+ ]),
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.14685.1.7"),
+}