Module: check_mk
Branch: master
Commit: d841e8d7be97bac4693b30db6140d93f1be77d25
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d841e8d7be97ba…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Nov 23 18:41:49 2017 +0100
5447 fjdarye500_ca_ports: New checks monitor IOps and throughput of Fujitsu storage CA
ports
Change-Id: Ibba38c6ffc81070dae490ddba82b1d80eb0a3944
---
.werks/5447 | 14 +++++
checkman/fjdarye500_ca_ports | 18 ++++++
checks/fjdarye500_ca_ports | 112 +++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 23 +++++++
4 files changed, 167 insertions(+)
diff --git a/.werks/5447 b/.werks/5447
new file mode 100644
index 0000000..e850e17
--- /dev/null
+++ b/.werks/5447
@@ -0,0 +1,14 @@
+Title: fjdarye500_ca_ports: New checks monitor IO and throughput of Fujitsu storage CA
ports
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i2
+Date: 1511458802
+Class: feature
+
+By default CA ports in mode 'CA' and 'CARA' are discovered.
+Moreover port indices can be configured in the related
+discovery rule 'Discovery of Fujtsu storage CA ports'.
+There are no hints in the SNMP data which ports are active
+thus the above rule may be useful.
diff --git a/checkman/fjdarye500_ca_ports b/checkman/fjdarye500_ca_ports
new file mode 100644
index 0000000..eec18ea
--- /dev/null
+++ b/checkman/fjdarye500_ca_ports
@@ -0,0 +1,18 @@
+title: Fujitsu storage systems: CA ports
+agents: snmp
+catalog: hw/storagehw/fujitsu
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the CA ports of Fujitsu storage systems
+ which support the FJDARY-E150-SNMPV2.MIB like the ETERNUS DX500 S3.
+
+ In the discovery rule 'Discovery of Fujtsu storage CA ports'
+ port indices and port modes are configurable.
+ By default CA ports in mode 'CA' and 'CARA' are discovered.
+
+item:
+ The CA port index.
+
+inventory:
+ One service per port is created.
diff --git a/checks/fjdarye500_ca_ports b/checks/fjdarye500_ca_ports
new file mode 100644
index 0000000..b1edaef
--- /dev/null
+++ b/checks/fjdarye500_ca_ports
@@ -0,0 +1,112 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2017 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-
+# tails. 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.
+
+
+inventory_fujitsu_ca_ports = []
+
+
+def parse_fjdarye500_ca_ports(info):
+ map_modes = {
+ "11": "CA",
+ "12": "RA",
+ "13": "CARA",
+ "20": "Initiator",
+ }
+
+ parsed = {}
+ for index, mode, read_iops, write_iops, read_mb, write_mb in info:
+ mode_readable = map_modes[mode]
+ port = parsed.setdefault(index, {
+ "mode": mode_readable,
+ "read_ios": int(read_iops),
+ "read_throughput": int(read_mb) * 1024**2,
+ })
+ if mode_readable != "Initiator":
+ port.update({
+ "write_ios": int(write_iops),
+ "write_throughput": int(write_mb) * 1024**2,
+ })
+ return parsed
+
+
+def inventory_fjdarye500_ca_ports(parsed):
+ settings = host_extra_conf_merged(host_name(), inventory_fujitsu_ca_ports)
+ indices = settings.get('indices')
+ modes = settings.get('modes', ['CA', 'CARA'])
+ for index, attrs in parsed.iteritems():
+ if indices and index not in indices:
+ continue
+ if modes and attrs['mode'] not in modes:
+ continue
+ yield index, {}
+
+
+def check_fjdarye500_ca_ports(item, params, parsed):
+ if item in parsed:
+ mode = parsed[item]["mode"]
+ yield 0, "Mode: %s" % mode
+ for state, infotext, perfdata in check_diskstat_dict(item, params, parsed):
+ if infotext and "Read: " in infotext and mode in ["CARA",
"Initiator"]:
+ infotext.replace("Read: ", "Initiator: ")
+ if infotext and "Write: " in infotext and mode ==
"CARA":
+ infotext.replace("Write: ", "Target: ")
+ yield state, infotext, perfdata
+
+
+check_info['fjdarye500_ca_ports'] = {
+ 'parse_function' : parse_fjdarye500_ca_ports,
+ 'inventory_function' : inventory_fjdarye500_ca_ports,
+ 'check_function' : check_fjdarye500_ca_ports,
+ 'service_description' : 'CA Port IO %s',
+ 'snmp_info' : ('.1.3.6.1.4.1.211.1.21.1.150.5.5.2.1', [
+ # fjdaryPfCaPortRdIOPS
+ # "This shows the READ IOPS for the CA,CARA
mode.
+ # The Initiator IOPS is shown for RA,Initiator
mode."
+ # fjdaryPfCaPortWtIOPS
+ # "This shows the WRITE IOPS for the CA,CARA
mode.
+ # The Target IOPS is shown for the RA mode.
+ # This information is an invalid value for the
Initiator mode."
+ # fjdaryPfCaPortRdTp
+ # "This shows the amount of the READ Throughput
for the CA,CARA mode.
+ # The Initiator Throughput is shown for RA,Initiator
mode.
+ # The unit is MB/sec."
+ # fjdaryPfCaPortWtTp
+ # "This shows the amount of the WRITE Throughput
for the CA,CARA mode.
+ # The Target Throughput is shown for the RA mode.
+ # The unit is MB/sec.
+ # This information is an invalid value for the
Initiator mode."
+ '1', # FJDARY-E150::fjdaryPfCaPortIndex
+ '2', # FJDARY-E150::fjdaryPfCaPortMode
+ '3', # FJDARY-E150::fjdaryPfCaPortRdIOPS
+ '4', # FJDARY-E150::fjdaryPfCaPortWtIOPS
+ '5', # FJDARY-E150::fjdaryPfCaPortRdTp
+ '6', # FJDARY-E150::fjdaryPfCaPortWtTp
+ ]),
+ 'snmp_scan_function' : lambda oid: oid(".1.3.6.1.2.1.1.2.0") ==
".1.3.6.1.4.1.211.1.21.1.150",
+ 'has_perfdata' : True,
+ 'group' : 'diskstat',
+ 'includes' : ['diskstat.include']
+}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index d9557a8..df192cf 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1588,6 +1588,29 @@ register_rule(group + '/' + subgroup_inventory,
match = "dict",
)
+register_rule(
+ "%s/%s" % (group, subgroup_inventory),
+ varname="inventory_fujitsu_ca_ports",
+ title=_("Discovery of Fujtsu storage CA ports"),
+ valuespec=Dictionary(
+ elements=[
+ ("indices", ListOfStrings(title=_("CA port indices"))),
+ ("modes", DualListChoice(
+ title=_("CA port modes"),
+ choices=[
+ ("CA", _("CA")),
+ ("RA", _("RA")),
+ ("CARA", _("CARA")),
+ ("Initiator", _("Initiator")),
+ ],
+ row=4,
+ size=30,
+ )),
+ ],
+ ),
+ match="dict",
+)
+
#.
# .--Applications--------------------------------------------------------.
# | _ _ _ _ _ |