Module: check_mk
Branch: master
Commit: 3e66c0cabad9b9676e711a64ee7c1aa3a7ed3a9f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3e66c0cabad9b9…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Thu Apr 10 13:03:34 2014 +0200
ibm_svc_enclosure: New Check for Enclosures, Canisters and PSUs in IBM SVC / Storwize
V3700 / V7000 devices
---
.werks/805 | 8 +++
ChangeLog | 1 +
agents/special/agent_ibmsvc | 12 +++--
checkman/ibm_svc_enclosure | 22 +++++++++
checks/ibm_svc_enclosure | 82 +++++++++++++++++++++++++++++++
web/plugins/wato/datasource_programs.py | 4 +-
6 files changed, 123 insertions(+), 6 deletions(-)
diff --git a/.werks/805 b/.werks/805
new file mode 100644
index 0000000..45353f8
--- /dev/null
+++ b/.werks/805
@@ -0,0 +1,8 @@
+Title: ibm_svc_enclosure: New Check for Enclosures, Canisters and PSUs in IBM SVC /
Storwize V3700 / V7000 devices
+Level: 1
+Component: checks
+Version: 1.2.5i3
+Date: 1397127773
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 9559a88..b9b0279 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,7 @@
* 0881 rmon_stats: now needs to be activated via a rule in order to be
inventorized...
NOTE: Please refer to the migration notes!
* 0804 ibm_svc_portfc: New check for status of FC Ports in IBM SVC / Storwize V3700 /
V7000 devices
+ * 0805 ibm_svc_enclosure: New Check for Enclosures, Canisters and PSUs in IBM SVC /
Storwize V3700 / V7000 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 d7347df..5ff2e88 100755
--- a/agents/special/agent_ibmsvc
+++ b/agents/special/agent_ibmsvc
@@ -62,10 +62,10 @@ OPTIONS:
which may contain the keywords "lshost",
"lslicense",
"lsmdisk", "lsmdiskgrp",
"lsnode", "lsnodestats",
"lssystem", "lssystemstats",
"lseventlog", "lsportfc"
- 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".
+ "lsenclosure" 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".
""")
@@ -111,8 +111,10 @@ command_options = {
"command" : "lssystemstats -nohdr -delim :"},
"lseventlog" : {"section_header" :
"ibm_svc_eventlog", "active" : False,
"command" : "lseventlog -expired no -fixed no
-monitoring no -order severity -message no -delim : -nohdr"},
- "lsportfc" : {"section_header" : "ibm_svc_portfc",
"active" : False,
+ "lsportfc" : {"section_header" : "ibm_svc_portfc",
"active" : False,
"command" : "lsportfc -nohdr -delim :"},
+ "lsenclosure" : {"section_header" :
"ibm_svc_enclosure", "active" : False,
+ "command" : "lsenclosure -nohdr -delim :"},
}
for o,a in opts:
diff --git a/checkman/ibm_svc_enclosure b/checkman/ibm_svc_enclosure
new file mode 100644
index 0000000..3314256
--- /dev/null
+++ b/checkman/ibm_svc_enclosure
@@ -0,0 +1,22 @@
+title: IBM SVC / Storwize V3700 / V7000: Status of Enclosures, Canisters and PSUs
+agents: ibm_svc
+catalog: hw/storagehw/ibm
+license: GPL
+distribution: check_mk
+description:
+ Checks the status of Enclosures, Canisters and PSUs in an IBM SVC / Storwize V3700 /
+ V7000 device.
+
+ Returns {OK} if the Enclousure report status {online} and all Canisters and PSUs
+ are online and {CRIT} otherwise.
+
+ 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 enclosure.
+
+inventory:
+ Creates one check for every enclosure.
diff --git a/checks/ibm_svc_enclosure b/checks/ibm_svc_enclosure
new file mode 100644
index 0000000..2d3907e
--- /dev/null
+++ b/checks/ibm_svc_enclosure
@@ -0,0 +1,82 @@
+#!/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_enclosure:sep(58)>>>
+# 1:online:control:yes:0:io_grp0:2072-24C:7804037:2:2:2:2:24
+# 2:online:expansion:yes:0:io_grp0:2072-24E:7804306:2:2:2:2:24
+# 3:online:expansion:yes:0:io_grp0:2072-24E:7804326:2:2:2:2:24
+# 4:online:expansion:yes:0:io_grp0:2072-24E:7804352:2:2:2:2:24
+
+def inventory_ibm_svc_enclosure(info):
+ inventory = []
+ for enclosure_id, enclosure_status, enclosure_type, managed, IO_group_id, \
+ IO_group_name, product_MTM, serial_number, total_canisters, online_canisters, \
+ total_PSUs, online_PSUs, drive_slots in info:
+ inventory.append( (enclosure_id, None) )
+ return inventory
+
+def check_ibm_svc_enclosure(item, _no_params, info):
+ for enclosure_id, enclosure_status, enclosure_type, managed, IO_group_id, \
+ IO_group_name, product_MTM, serial_number, total_canisters, online_canisters, \
+ total_PSUs, online_PSUs, drive_slots in info:
+ if enclosure_id == item:
+
+ # Check status
+ message = "Enclosure %s is %s" % (enclosure_id, enclosure_status)
+ if enclosure_status == "online":
+ status = 0
+ else:
+ status = 2
+ message += "(!!)"
+
+ # Check canisters
+ if online_canisters == total_canisters:
+ status = max(0, status)
+ message += ", all %s canisters are online" % total_canisters
+ else:
+ status = max(2, status)
+ message += ", %s(!!) of %s canisters are online" %
(online_canisters, total_canisters)
+
+ # Check PSUs
+ if online_PSUs == total_PSUs:
+ status = max(0, status)
+ message += ", all %s PSUs are online" % total_PSUs
+ else:
+ status = max(2, status)
+ message += ", %s(!!) of %s PSUs are online" % (online_PSUs,
total_PSUs)
+
+ return status, message
+
+ return 3, "Enclosure %s not found in agent output" % item
+
+check_info["ibm_svc_enclosure"] = {
+ "check_function" : check_ibm_svc_enclosure,
+ "inventory_function" : inventory_ibm_svc_enclosure,
+ "service_description" : "IBM SVC Enclosure %s",
+ "has_perfdata" : False,
+}
+
diff --git a/web/plugins/wato/datasource_programs.py
b/web/plugins/wato/datasource_programs.py
index dc3e306..00fa7ae 100644
--- a/web/plugins/wato/datasource_programs.py
+++ b/web/plugins/wato/datasource_programs.py
@@ -275,9 +275,11 @@ register_rule(group,
( "lssystemstats", _("System Stats") ),
( "lseventlog", _("Event Log") ),
( "lsportfc", _("FC Ports") ),
+ ( "lsenclosure", _("Enclosures") ),
],
default_value = [ "lshost", "lslicense",
"lsmdisk", "lsmdiskgrp", "lsnode",
- "lsnodestats", "lssystem",
"lssystemstats", "lsportfc" ],
+ "lsnodestats", "lssystem",
"lssystemstats", "lsportfc",
+ "lsenclosure" ],
allow_empty = False,
),
title = _("Retrieve information about..."),