Module: check_mk
Branch: master
Commit: 66686a07c13972c5e8416ca72037c759edf00517
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=66686a07c13972…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Sat Jun 13 15:32:23 2015 +0200
minor changes to werk 2124
---
.werks/2124 | 2 +-
ChangeLog | 2 +-
checks/datapower_pdrive | 93 +++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 95 insertions(+), 2 deletions(-)
diff --git a/.werks/2124 b/.werks/2124
index 411cda0..c555262 100644
--- a/.werks/2124
+++ b/.werks/2124
@@ -1,4 +1,4 @@
-Title: # new file: datapower_pdrive, datapower_ldrive: new checks to monitor disk
states of IBM Datapower Gateways
+Title: datapower_pdrive, datapower_ldrive: new checks to monitor disk states of IBM
Datapower Gateways
Level: 1
Component: checks
Compatible: compat
diff --git a/ChangeLog b/ChangeLog
index 609aa7a..c344f10 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,7 +19,7 @@
* 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
* 2123 datapower_fs: new check to monitor filesystems on IBMs Datapower Gateways
- * 2124 # new file: datapower_pdrive, datapower_ldrive: new checks to monitor
disk states of IBM Datapower Gateways
+ * 2124 datapower_pdrive, datapower_ldrive: new checks to monitor disk states 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/checks/datapower_pdrive b/checks/datapower_pdrive
new file mode 100644
index 0000000..3ef3adf
--- /dev/null
+++ b/checks/datapower_pdrive
@@ -0,0 +1,93 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2015 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.
+
+def inventory_datapower_pdrive(info):
+ for controller, device, ldrive, position, status, progress, vendor, product, fail in
info:
+ if status != "12":
+ item = "%s-%s" % (controller, device)
+ yield item, None
+
+def check_datapower_pdrive(item, _no_params, info):
+ datapower_pdrive_status = {
+ "1": (0, "Unconfigured/Good"),
+ "2": (0, "Unconfigured/Good/Foreign"),
+ "3": (1, "Unconfigured/Bad"),
+ "4": (1, "Unconfigured/Bad/Foreign"),
+ "5": (0, "Hot spare"),
+ "6": (1, "Offline"),
+ "7": (2, "Failed"),
+ "8": (1, "Rebuilding"),
+ "9": (0, "Online"),
+ "10": (1, "Copyback"),
+ "11": (1, "System"),
+ "12": (1, "Undefined"),
+ }
+ datapower_pdrive_fail = {
+ "1": (2, "disk reports failure"),
+ "2": (0, "disk reports no failure"),
+ }
+ datapower_pdrive_position = {
+ "1": "HDD 0",
+ "2": "HDD 1",
+ "3": "HDD 2",
+ "4": "HDD 3",
+ "5": "undefined",
+ }
+ for controller, device, ldrive, position, status, progress, vendor, product, fail in
info:
+ if item == "%s-%s" % (controller, device):
+ member_of_ldrive = "%s-%s" % (controller, ldrive)
+ state, state_txt = datapower_pdrive_status[status]
+ position_txt = datapower_pdrive_position[position]
+ if int(progress) != 0:
+ progress_txt = " - Progress: %s%%" % progress
+ else:
+ progress_txt = ""
+ infotext = "%s%s, Position: %s, Logical Drive: %s, Product: %s
%s"\
+ % (state_txt, progress_txt, position_txt, member_of_ldrive, vendor,
product)
+ yield state, infotext
+
+ if fail:
+ yield datapower_pdrive_fail[fail]
+
+check_info['datapower_pdrive'] = {
+ "inventory_function" : inventory_datapower_pdrive,
+ "check_function" : check_datapower_pdrive,
+ "service_description" : "Physical Drive %s",
+ "snmp_info" : ( ".1.3.6.1.4.1.14685.3.1.260.1", [
+ "1", #
dpStatusRaidPhysicaldrivetatusControllerID
+ "2", #
dpStatusRaidPhysicaldrivetatusDeviceID
+ "4", #
dpStatusRaidPhysicaldrivetatusLogicalDriveID
+ "6", #
dpStatusRaidPhysicaldrivetatusPosition
+ "7", # dpStatusRaidPhysicaldrivetatusState
+ "8", #
dpStatusRaidPhysicaldrivetatusProgressPercent
+ "14", #
dpStatusRaidPhysicaldrivetatusVendorID
+ "15", #
dpStatusRaidPhysicaldrivetatusProductID
+ "18", #
dpStatusRaidPhysicaldrivetatusFailure
+ ]),
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0")
== ".1.3.6.1.4.1.14685.1.7",
+
+
+}