Module: check_mk
Branch: master
Commit: 7b69bcf4bd5ca7b459a244ab86d983234e3b2153
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7b69bcf4bd5ca7…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Wed Jan 21 16:53:10 2015 +0100
ibm_svc_portsas: new check and extended special agent for IBM SVC / Storwize V3700 / V7000
devices
---
.werks/1857 | 9 +++++++
ChangeLog | 1 +
agents/special/agent_ibmsvc | 8 ++++---
checkman/ibm_svc_portsas | 22 +++++++++++++++++
checks/ibm_svc_portsas | 55 +++++++++++++++++++++++++++++++++++++++++++
5 files changed, 92 insertions(+), 3 deletions(-)
diff --git a/.werks/1857 b/.werks/1857
new file mode 100644
index 0000000..3186844
--- /dev/null
+++ b/.werks/1857
@@ -0,0 +1,9 @@
+Title: ibm_svc_portsas: new check and extended special agent for IBM SVC / Storwize V3700
/ V7000 devices
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1421855429
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 41d37fd..7281e67 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -54,6 +54,7 @@
NOTE: Please refer to the migration notes!
* 1888 bintec_sensors.fan: No longer outputs performance data, now configured via
"fan" rule...
NOTE: Please refer to the migration notes!
+ * 1857 ibm_svc_portsas: new check and extended special agent for IBM SVC / Storwize
V3700 / V7000 devices
* 1457 FIX: logins: new check renamed from "users" check...
NOTE: Please refer to the migration notes!
* 1762 FIX: lnx_thermal: Now ignoring trip points with level 0...
diff --git a/agents/special/agent_ibmsvc b/agents/special/agent_ibmsvc
index 5a43d43..427cf2f 100755
--- a/agents/special/agent_ibmsvc
+++ b/agents/special/agent_ibmsvc
@@ -62,9 +62,9 @@ OPTIONS:
which may contain the keywords "lshost",
"lslicense",
"lsmdisk", "lsmdiskgrp",
"lsnode", "lsnodestats",
"lssystem", "lssystemstats",
"lseventlog", "lsportfc"
- "lsenclosure", "lsenclosurestats",
"lsarray" or "all"
- to define which information should be queried from
- the device.
+ "lsenclosure", "lsenclosurestats",
"lsarray", "lsportsas"
+ 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".
@@ -120,6 +120,8 @@ command_options = {
"command" : "lsenclosurestats -nohdr -delim
:"},
"lsarray" : {"section_header" : "ibm_svc_array",
"active" : False,
"command" : "lsarray -nohdr -delim :"},
+ "lsportsas" : {"section_header" :
"ibm_svc_portsas", "active" : False,
+ "command" : "lsportsas -nohdr -delim :"},
}
for o,a in opts:
diff --git a/checkman/ibm_svc_portsas b/checkman/ibm_svc_portsas
new file mode 100644
index 0000000..ffca097
--- /dev/null
+++ b/checkman/ibm_svc_portsas
@@ -0,0 +1,22 @@
+title: IBM SVC / Storwize V3700 / V7000: Status of SAS Ports
+agents: ibm_svc
+catalog: hw/storagehw/ibm
+license: GPL
+distribution: check_mk
+description:
+ Checks the status of SAS Ports in an IBM SVC / Storwize V3700 / V7000
+ device.
+
+ Status {online} 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 keys. The Special Agent itself
+ can be configured by WATO.
+
+item:
+ The ID of the SAS Port.
+
+inventory:
+ Creates one check for every SAS Port in the IBM SVC / Storwize V3700 / V7000 device
+ with status not {offline_unconfigured}.
diff --git a/checks/ibm_svc_portsas b/checks/ibm_svc_portsas
new file mode 100644
index 0000000..7f3ef62
--- /dev/null
+++ b/checks/ibm_svc_portsas
@@ -0,0 +1,55 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 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_ibm_svc_portsas(info):
+ for line in info:
+ if len(line) in (10, 12) and line[6] != "offline_unconfigured":
+ yield line[0], None
+
+def check_ibm_svc_portsas(item, _no_params, info):
+ for line in info:
+ if len(line) in (10, 12) and line[0] == item:
+ sasport_status = line[6]
+ sasport_speed = line[2]
+ sasport_type = line[9]
+
+ infotext = "Status: %s" % sasport_status
+ if sasport_status == "online":
+ state = 0
+ else:
+ state = 2
+ infotext += "(!!)"
+
+ infotext += ", Speed: %s, Type: %s" % (sasport_speed,
sasport_type)
+
+ return state, infotext
+
+check_info["ibm_svc_portsas"] = {
+ "check_function" : check_ibm_svc_portsas,
+ "inventory_function" : inventory_ibm_svc_portsas,
+ "service_description" : "SAS Port %s",
+}