Module: check_mk
Branch: master
Commit: 21406af93f1c1eb186ac97c9a101d4aa9a7f08b2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=21406af93f1c1e…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Wed Apr 30 12:40:20 2014 +0200
ibm_svc_array: New check for Status of RAID Arrays in IBM SVC / Storwize devices.
---
.werks/952 | 8 ++++
ChangeLog | 1 +
agents/special/agent_ibmsvc | 7 ++-
checkman/ibm_svc_array | 26 +++++++++++
checks/ibm_svc_array | 71 +++++++++++++++++++++++++++++++
web/plugins/wato/datasource_programs.py | 5 ++-
6 files changed, 114 insertions(+), 4 deletions(-)
diff --git a/.werks/952 b/.werks/952
new file mode 100644
index 0000000..2b51cf5
--- /dev/null
+++ b/.werks/952
@@ -0,0 +1,8 @@
+Title: ibm_svc_array: New check for Status of RAID Arrays in IBM SVC / Storwize devices.
+Level: 1
+Component: checks
+Version: 1.2.5i3
+Date: 1398854374
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 3cc3a5b..5cf1b1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,6 +40,7 @@
* 0156 akcp_daisy_temp: New Check for akcp daisyTemp sensor chains...
* 0899 enterasys_temp: New Check for temperature sensor in Enterasys Switches
* 0901 ibm_svc_portfc: more devices recognized...
+ * 0952 ibm_svc_array: New check for Status of RAID Arrays in IBM SVC / Storwize
devices.
* 0777 FIX: special agent emcvnx: did not work with security file authentication...
* 0786 FIX: zfsget: fixed compatibility with older Solaris agents...
* 0809 FIX: brocade_fcport: Fixed recently introduced problem with port speed
detection
diff --git a/agents/special/agent_ibmsvc b/agents/special/agent_ibmsvc
index 8be2635..ba51bba 100755
--- a/agents/special/agent_ibmsvc
+++ b/agents/special/agent_ibmsvc
@@ -62,8 +62,9 @@ OPTIONS:
which may contain the keywords "lshost",
"lslicense",
"lsmdisk", "lsmdiskgrp",
"lsnode", "lsnodestats",
"lssystem", "lssystemstats",
"lseventlog", "lsportfc"
- "lsenclosure", "lsenclosurestats" or
"all" to define
- which information should be queried from the device.
+ "lsenclosure", "lsenclosurestats",
"lsarray" or "all"
+ to define which information should be queried from
+ the device.
You can define to use only view of them to optimize
performance. The default is "all".
@@ -117,6 +118,8 @@ command_options = {
"command" : "lsenclosure -nohdr -delim :"},
"lsenclosurestats" : {"section_header" :
"ibm_svc_enclosurestats", "active" : False,
"command" : "lsenclosurestats -nohdr -delim
:"},
+ "lsarray" : {"section_header" : "ibm_svc_array",
"active" : False,
+ "command" : "lsarray -nohdr -delim :"},
}
for o,a in opts:
diff --git a/checkman/ibm_svc_array b/checkman/ibm_svc_array
new file mode 100644
index 0000000..0324051
--- /dev/null
+++ b/checkman/ibm_svc_array
@@ -0,0 +1,26 @@
+title: IBM SVC / Storwize V3700 / V7000: Status of RAID Arrays
+agents: ibm_svc
+catalog: hw/storagehw/ibm
+license: GPL
+distribution: check_mk
+description:
+ Checks the status of RAID Arrays in an IBM SVC / Storwize V3700 / V7000
+ device.
+
+ Status {online} is {OK}, status {offline} and {degraded} are {CRIT} and
+ every other status is {WARN}.
+
+ Other informations given in the check output is just informational and
+ does not trigger any state change.
+
+ Please note: You need the Special Agent agent_ibmsvc to retrieve the monitoring
+ data from the device. Your monitoring user must be able to SSH to the device
+ with SSH Key Authentification. Please exchange SSH key. The Special Agent itself
+ can be configured by WATO.
+
+item:
+ The ID of the RAID Array as delivered by lsarray command.
+
+inventory:
+ Creates one check for every RAID Array on the IBM SVC / Storwize V3700 / V7000
+ device.
diff --git a/checks/ibm_svc_array b/checks/ibm_svc_array
new file mode 100644
index 0000000..19c114b
--- /dev/null
+++ b/checks/ibm_svc_array
@@ -0,0 +1,71 @@
+#!/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_array:sep(58)>>>
+# 27:SSD_mdisk27:online:1:POOL_0_V7000_RZ:372.1GB:online:raid1:1:256:generic_ssd
+# 28:SSD_mdisk28:online:2:POOL_1_V7000_BRZ:372.1GB:online:raid1:1:256:generic_ssd
+# 29:SSD_mdisk0:online:1:POOL_0_V7000_RZ:372.1GB:online:raid1:1:256:generic_ssd
+# 30:SSD_mdisk1:online:2:POOL_1_V7000_BRZ:372.1GB:online:raid1:1:256:generic_ssd
+
+
+def inventory_ibm_svc_array(info):
+ inventory = []
+ for mdisk_id, mdisk_name, mdisk_status, mdisk_grp_id, mdisk_grp_name, capacity, \
+ raid_status, raid_level, redundancy, strip_size, tier in info:
+ inventory.append( (mdisk_id, None) )
+ return inventory
+
+def check_ibm_svc_array(item, _no_params, info):
+ status = 3
+ for mdisk_id, mdisk_name, mdisk_status, mdisk_grp_id, mdisk_grp_name, capacity, \
+ raid_status, raid_level, redundancy, strip_size, tier in info:
+ if mdisk_id == item:
+
+ # Check raid_status
+ message = "RAID Array %s reports status %s" % (item, raid_status)
+ if raid_status == "online":
+ status = 0
+ elif raid_status == "offline" or raid_status ==
"degraded":
+ status = 2
+ message += "(!!)"
+ else:
+ status = 1
+ message += "(!)"
+
+ # add information
+ message += ", RAID Level: %s, Tier: %s" % (raid_level, tier)
+
+ return status, message
+ return 3, "RAID Array %s not found in agent output" % item
+
+check_info["ibm_svc_array"] = {
+ "check_function" : check_ibm_svc_array,
+ "inventory_function" : inventory_ibm_svc_array,
+ "service_description" : "IBM SVC RAID Array %s",
+ "has_perfdata" : False,
+}
+
diff --git a/web/plugins/wato/datasource_programs.py
b/web/plugins/wato/datasource_programs.py
index a69cec5..7cb00e5 100644
--- a/web/plugins/wato/datasource_programs.py
+++ b/web/plugins/wato/datasource_programs.py
@@ -40,7 +40,7 @@ register_rule(group,
"via SSH. The command line may contain the placeholders
<tt><IP></tt> and "
"<tt><HOST></tt>."),
label = _("Command line to execute"),
- empty_text = _("Access Check_MK Agent via TCP"),
+ empty_text = _("Access Check_MK Agent via TCP"),
size = 80,
attrencode = True))
@@ -277,10 +277,11 @@ register_rule(group,
( "lsportfc", _("FC Ports") ),
( "lsenclosure", _("Enclosures") ),
( "lsenclosurestats", _("Enclosure Stats")
),
+ ( "lsarray", _("RAID Arrays") ),
],
default_value = [ "lshost", "lslicense",
"lsmdisk", "lsmdiskgrp", "lsnode",
"lsnodestats", "lssystem",
"lssystemstats", "lsportfc",
- "lsenclosure",
"lsenclosurestats" ],
+ "lsenclosure",
"lsenclosurestats", "lsarray" ],
allow_empty = False,
),
title = _("Retrieve information about..."),