Module: check_mk
Branch: master
Commit: 3e671e09560b268f683c58c7b22f3da7209fdb41
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3e671e09560b26…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Tue Mar 25 15:26:22 2014 +0100
ibm_svc_mdisk: new check for status and mode of MDisks in an IBM SVC / V7000 device
---
.werks/769 | 8 +++++
ChangeLog | 1 +
checkman/ibm_svc_mdisk | 17 +++++++++++
checks/ibm_svc_mdisk | 78 ++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 104 insertions(+)
diff --git a/.werks/769 b/.werks/769
new file mode 100644
index 0000000..6e49114
--- /dev/null
+++ b/.werks/769
@@ -0,0 +1,8 @@
+Title: ibm_svc_mdisk: new check for status and mode of MDisks in an IBM SVC / V7000
device
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1395757553
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 04ffb59..ce1239a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -130,6 +130,7 @@
* 0707 ibm_svc_host: New check: Status of hosts an IBM SVC / V7000 presents volumes
to
* 0598 kentix_temp, kentix_humidity: new checks for Kentix MultiSensor-Rack
* 0768 ibm_svc_license: New check for Licensing Status on IBM SVC / V7000 devices
+ * 0769 ibm_svc_mdisk: new check for status and mode of MDisks in an IBM SVC / V7000
device
* 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/ibm_svc_mdisk b/checkman/ibm_svc_mdisk
new file mode 100644
index 0000000..b870de4
--- /dev/null
+++ b/checkman/ibm_svc_mdisk
@@ -0,0 +1,17 @@
+title: IBM SVC / V7000: Status and Mode of MDisks
+agents: ibm_svc
+catalog: hw/storagehw/ibm
+license: GPL
+distribution: check_mk
+description:
+ Checks the status and mode of MDisks in an IBM SVC / V7000 device.
+
+ Status {online} is {OK}, status {offline} and {excluded} are {CRIT} and
+ every other status is {WARN}.
+
+ Mode {managed} is {OK} and every other mode is {WARN}.
+
+ The worst of both is returned as check result.
+
+inventory:
+ Creates one check for every MDisk in th IBM SVC / V7000 device.
diff --git a/checks/ibm_svc_mdisk b/checks/ibm_svc_mdisk
new file mode 100644
index 0000000..2422ae6
--- /dev/null
+++ b/checks/ibm_svc_mdisk
@@ -0,0 +1,78 @@
+#!/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.
+
+# Example output from agent:
+# <<<ibm_svc_mdisk:sep(58)>>>
+#
0:stp5_300G_01-01:online:managed:16:stp5_300G_01:1.1TB:0000000000000000:BLUBB5:600a0b80006e1dbc0000f6f9513026a000000000000000000000000000000000:generic_hdd
+#
1:Quorum_BLUBB3:online:managed:0:Quorum_2:1.0GB:0000000000000000:BLUBB3:600a0b8000293eb800001f264c3e8a1f00000000000000000000000000000000:generic_hdd
+#
2:stp6_300G_01-01:online:managed:15:stp6_300G_01:1.1TB:0000000000000000:BLUBB6:600a0b80006e8e3c00000f1651302b8800000000000000000000000000000000:generic_hdd
+#
3:Quorum_blubb5:online:managed:18:Quorum_0:1.0GB:0000000000000001:BLUBB5:600a0b80006e1dcc0000f6905130225800000000000000000000000000000000:generic_hdd
+#
4:Quorum_blubb6:online:managed:17:Quorum_1:1.0GB:0000000000000001:BLUBB6:600a0b80006e1d5e00000dcb5130228700000000000000000000000000000000:generic_hdd
+#
5:stp5_300G_01-02:online:managed:16:stp5_300G_01:1.1TB:0000000000000002:BLUBB5:600a0b80006e1dbc0000f6fc51304bfc00000000000000000000000000000000:generic_hdd
+#
6:stp6_300G_01-02:online:managed:15:stp6_300G_01:1.1TB:0000000000000002:BLUBB6:600a0b80006e8e3c00000f1951304f9a00000000000000000000000000000000:generic_hdd
+#
7:stp5_300G_01-03:online:managed:16:stp5_300G_01:1.1TB:0000000000000003:BLUBB5:600a0b80006e1dcc0000f76951305bc000000000000000000000000000000000:generic_hdd
+#
8:stp6_300G_01-03:online:managed:15:stp6_300G_01:1.1TB:0000000000000003:BLUBB6:600a0b80006e1d5e00000e9a51305a3200000000000000000000000000000000:generic_hdd
+#
9:stp5_300G_01-04:online:managed:16:stp5_300G_01:1.1TB:0000000000000004:BLUBB5:600a0b80006e1dbc0000f7d051341cc000000000000000000000000000000000:generic_hdd
+
+
+def inventory_ibm_svc_mdisk(info):
+ inventory = []
+ for mdisk_id, mdisk_name, mdisk_status, mdisk_mode, mdisk_grp_id, mdisk_grp_name,
capacity, ctrl_lun_number, controller_name, mdisk_uid, tier in info:
+ inventory.append( (mdisk_name, None) )
+ return inventory
+
+def check_ibm_svc_mdisk(item, _no_params, info):
+ status = 3
+ for mdisk_id, mdisk_name, mdisk_status, mdisk_mode, mdisk_grp_id, mdisk_grp_name,
capacity, ctrl_lun_number, controller_name, mdisk_uid, tier in info:
+ if mdisk_name == item:
+
+ # Check mdisk_status
+ message = "%s reports status %s" % (item, mdisk_status)
+ if mdisk_status == "online":
+ status = 0
+ elif mdisk_status == "offline" or mdisk_status ==
"excluded":
+ status = 2
+ message += "(!!)"
+ else:
+ status = 1
+ message += "(!)"
+
+ # check mdisk_mode
+ message += ", Mode %s" % mdisk_mode
+ if mdisk_mode != "managed":
+ status = max(status, 1)
+ message += "(!)"
+
+ return status, message
+ return 3, "MDisk %s not found in agent output" % item
+
+check_info["ibm_svc_mdisk"] = {
+ "check_function" : check_ibm_svc_mdisk,
+ "inventory_function" : inventory_ibm_svc_mdisk,
+ "service_description" : "IBM SVC MDisk %s",
+ "has_perfdata" : False,
+}
+