Module: check_mk
Branch: master
Commit: 91e992255494066528fc9b7176f23dc083795ccb
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=91e99225549406…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Tue Mar 25 18:11:06 2014 +0100
ibm_svc_node: new check for status of IO Groups of IBM SVC / V7000 devices
---
.werks/771 | 8 +++++
ChangeLog | 1 +
checkman/ibm_svc_node | 18 +++++++++++
checks/ibm_svc_node | 79 +++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 106 insertions(+)
diff --git a/.werks/771 b/.werks/771
new file mode 100644
index 0000000..419f531
--- /dev/null
+++ b/.werks/771
@@ -0,0 +1,8 @@
+Title: ibm_svc_node: new check for status of IO Groups of IBM SVC / V7000 devices
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1395767425
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 3f2c08e..52da8d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -132,6 +132,7 @@
* 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
* 0770 ibm_svc_mdiskgrp: New check for status and usage of MDisksGrps in IBM SVC /
V7000 devices
+ * 0771 ibm_svc_node: new check for status of IO Groups of IBM SVC / V7000 devices
* 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_node b/checkman/ibm_svc_node
new file mode 100644
index 0000000..83265fe
--- /dev/null
+++ b/checkman/ibm_svc_node
@@ -0,0 +1,18 @@
+title: IBM SVC / V7000: Status of IO Groups
+agents: ibm_svc
+catalog: hw/storagehw/ibm
+license: GPL
+distribution: check_mk
+description:
+ Checks the status of IO Groups of an IBM SVC / V7000 device.
+
+ If all nodes of an IO Group report status {online} the check returns
+ {OK}. If all nodes of an IO Group report some other status (e. g.
+ {offline}) the check returns {CRIT}. And in all other cases - that
+ means if at least one node is {online} - the check returns {WARN}.
+
+item:
+ The name of the IO Group.
+
+inventory:
+ Creates one check for every IO Group in an IBM SVC / V7000 device.
diff --git a/checks/ibm_svc_node b/checks/ibm_svc_node
new file mode 100644
index 0000000..31b4691
--- /dev/null
+++ b/checks/ibm_svc_node
@@ -0,0 +1,79 @@
+#!/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:
+# Put here the example output from your TCP-Based agent. If the
+# check is SNMP-Based, then remove this section
+
+def inventory_ibm_svc_node(info):
+ io_groups = {}
+ inventory = []
+ for node_id, node_name, ups_serial, wwnn, node_status, io_group_id, \
+ io_group_name, config_node, ups_unique_id, hardware, iscsi_name, \
+ iscsi_alias, panel_name, enclosure_id, canister_id, \
+ enclosure_serial_number, additional in info:
+ io_groups[io_group_name] = 1
+ for io_group_name in io_groups.keys():
+ inventory.append( (io_group_name, None) )
+ return inventory
+
+def check_ibm_svc_node(item, _no_params, info):
+ message = ""
+ status = 0
+ online_nodes = 0
+ nodes_of_iogroup = 0
+
+ for node_id, node_name, ups_serial, wwnn, node_status, io_group_id, \
+ io_group_name, config_node, ups_unique_id, hardware, iscsi_name, \
+ iscsi_alias, panel_name, enclosure_id, canister_id, \
+ enclosure_serial_number, additional in info:
+ if io_group_name == item:
+ if message != "":
+ message += ", "
+ message += "Node %s is %s" % (node_name, node_status)
+ nodes_of_iogroup += 1
+ if node_status == "online":
+ online_nodes += 1
+
+ if nodes_of_iogroup == 0:
+ return 3, "IO Group %s not found in agent output" % item
+
+ if nodes_of_iogroup == online_nodes:
+ status = 0
+ elif online_nodes == 0:
+ status = 2
+ else:
+ status = 1
+
+ return status, message
+
+check_info["ibm_svc_node"] = {
+ "check_function" : check_ibm_svc_node,
+ "inventory_function" : inventory_ibm_svc_node,
+ "service_description" : "IBM SVC IO Group %s",
+ "has_perfdata" : False,
+}
+