Module: check_mk
Branch: master
Commit: f5f24e1c5370572a8f04708963942af5e136fc88
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f5f24e1c537057…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Thu Apr 10 12:06:53 2014 +0200
ibm_svc_portfc: New check for status of FC Ports in IBM SVC / Storwize V3700 / V7000
devices
---
.werks/804 | 8 ++++
ChangeLog | 1 +
agents/special/agent_ibmsvc | 11 ++++--
checkman/ibm_svc_portfc | 22 +++++++++++
checks/ibm_svc_portfc | 63 +++++++++++++++++++++++++++++++
web/plugins/wato/datasource_programs.py | 3 +-
6 files changed, 103 insertions(+), 5 deletions(-)
diff --git a/.werks/804 b/.werks/804
new file mode 100644
index 0000000..d706792
--- /dev/null
+++ b/.werks/804
@@ -0,0 +1,8 @@
+Title: ibm_svc_portfc: New check for status of FC Ports in IBM SVC / Storwize V3700 /
V7000 devices
+Level: 1
+Component: checks
+Version: 1.2.5i3
+Date: 1397124376
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 8e4293a..c783c60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,7 @@
* 0879 windows_tasks: output last and next run time
* 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
* 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 91b4e07..d7347df 100755
--- a/agents/special/agent_ibmsvc
+++ b/agents/special/agent_ibmsvc
@@ -61,10 +61,11 @@ OPTIONS:
-i MODULES, --modules MODULES Modules to query. This is a comma separated list of
which may contain the keywords "lshost",
"lslicense",
"lsmdisk", "lsmdiskgrp",
"lsnode", "lsnodestats",
- "lssystem", "lssystemstats",
"lseventlog" 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".
+ "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".
""")
@@ -110,6 +111,8 @@ 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,
+ "command" : "lsportfc -nohdr -delim :"},
}
for o,a in opts:
diff --git a/checkman/ibm_svc_portfc b/checkman/ibm_svc_portfc
new file mode 100644
index 0000000..0421b7c
--- /dev/null
+++ b/checkman/ibm_svc_portfc
@@ -0,0 +1,22 @@
+title: IBM SVC / Storwize V3700 / V7000: Status of FC Ports
+agents: ibm_svc
+catalog: hw/storagehw/ibm
+license: GPL
+distribution: check_mk
+description:
+ Checks the status of FC Ports in an IBM SVC / Storwize V3700 / V7000
+ device.
+
+ Status {active} is {OK}, every other status is {CRIT}.
+
+ 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 FC Port.
+
+inventory:
+ Creates one check for every FC Port in the IBM SVC / Storwize V3700 / V7000 device
+ with status {active}.
diff --git a/checks/ibm_svc_portfc b/checks/ibm_svc_portfc
new file mode 100644
index 0000000..6b96782
--- /dev/null
+++ b/checks/ibm_svc_portfc
@@ -0,0 +1,63 @@
+#!/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_portfc:sep(58)>>>
+# 0:1:1:fc:8Gb:1:node1:5005076803042126:030400:active:switch
+# 1:2:2:fc:8Gb:1:node1:5005076803082126:040400:active:switch
+# 2:3:3:fc:N/A:1:node1:50050768030C2126:000000:inactive_unconfigured:none
+# 3:4:4:fc:N/A:1:node1:5005076803102126:000000:inactive_unconfigured:none
+# 8:1:1:fc:8Gb:2:node2:5005076803042127:030500:active:switch
+# 9:2:2:fc:8Gb:2:node2:5005076803082127:040500:active:switch
+# 10:3:3:fc:N/A:2:node2:50050768030C2127:000000:inactive_unconfigured:none
+# 11:4:4:fc:N/A:2:node2:5005076803102127:000000:inactive_unconfigured:none
+
+def inventory_ibm_svc_portfc(info):
+ inventory = []
+ for fc_port_id, fc_io_port_id, port_id, fc_port_type, port_speed, \
+ node_id, node_name, WWPN, nportid, fc_port_status, attachment in info:
+ if fc_port_status == "active":
+ inventory.append( (fc_port_id, None) )
+ return inventory
+
+def check_ibm_svc_portfc(item, _no_params, info):
+ for fc_port_id, fc_io_port_id, port_id, fc_port_type, port_speed, \
+ node_id, node_name, WWPN, nportid, fc_port_status, attachment in info:
+ if fc_port_id == item:
+ if fc_port_status == "active":
+ return 0, "FC Port %s is %s" % (fc_port_id, fc_port_status)
+ else:
+ return 2, "FC Port %s is %s" % (fc_port_id, fc_port_status)
+
+ return 3, "FC Port %s not found in agent output" % item
+
+check_info["ibm_svc_portfc"] = {
+ "check_function" : check_ibm_svc_portfc,
+ "inventory_function" : inventory_ibm_svc_portfc,
+ "service_description" : "IBM SVC FC Port %s",
+ "has_perfdata" : False,
+}
+
diff --git a/web/plugins/wato/datasource_programs.py
b/web/plugins/wato/datasource_programs.py
index 990095a..dc3e306 100644
--- a/web/plugins/wato/datasource_programs.py
+++ b/web/plugins/wato/datasource_programs.py
@@ -274,9 +274,10 @@ register_rule(group,
( "lssystem", _("System Info") ),
( "lssystemstats", _("System Stats") ),
( "lseventlog", _("Event Log") ),
+ ( "lsportfc", _("FC Ports") ),
],
default_value = [ "lshost", "lslicense",
"lsmdisk", "lsmdiskgrp", "lsnode",
- "lsnodestats", "lssystem",
"lssystemstats", ],
+ "lsnodestats", "lssystem",
"lssystemstats", "lsportfc" ],
allow_empty = False,
),
title = _("Retrieve information about..."),