Module: check_mk
Branch: master
Commit: de60cab2c2f8102e4787b973b3de6e1a73ae6c3b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=de60cab2c2f810…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri Mar 28 15:04:29 2014 +0100
ibm_svc_systemstats.diskio: new check for disk throughput in IBM SVC / V7000 devices in
total
---
.werks/775 | 8 ++
ChangeLog | 1 +
checkman/ibm_svc_systemstats.diskio | 19 ++++
checks/ibm_svc_systemstats | 120 ++++++++++++++++++++
.../check_mk-ibm_svc_systemstats.diskio.php | 1 +
web/plugins/perfometer/check_mk.py | 1 +
web/plugins/wato/datasource_programs.py | 6 +-
7 files changed, 152 insertions(+), 4 deletions(-)
diff --git a/.werks/775 b/.werks/775
new file mode 100644
index 0000000..cd46a9f
--- /dev/null
+++ b/.werks/775
@@ -0,0 +1,8 @@
+Title: ibm_svc_systemstats.diskio: new check for disk throughput in IBM SVC / V7000
devices in total
+Level: 1
+Component: checks
+Version: 1.2.5i2
+Date: 1396015424
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index aab5f25..ffbc71b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
Checks & Agents:
* 0147 enterasys_fans: New Check to monitor fans of enterasys swichtes
* 0774 ibm_svc_nodestats.diskio: new check for disk troughput per node on IBM SVC /
V7000 devices
+ * 0775 ibm_svc_systemstats.diskio: new check for disk throughput in IBM SVC / V7000
devices in total
1.2.5i1:
diff --git a/checkman/ibm_svc_systemstats.diskio b/checkman/ibm_svc_systemstats.diskio
new file mode 100644
index 0000000..ef46e95
--- /dev/null
+++ b/checkman/ibm_svc_systemstats.diskio
@@ -0,0 +1,19 @@
+title: IBM SVC / V7000: Disk Throughput for Drives/MDisks/VDisks in Total
+agents: ibm_svc
+catalog: hw/storagehw/ibm
+license: GPL
+distribution: check_mk
+description:
+ Reports the disk throughput for Drives, MDisks and VDisks of an IBM
+ SVC / V7000 device in total in bytes per second.
+
+ The check is only for reporting and returns always {OK}.
+
+item:
+ "Drives", "MDisks" or "VDisks"
+
+inventory:
+ Creates one check for Drives, one for MDisks and one for VDisks.
+
+perfdata:
+ Two values: Throughput read and throughput write in Bytes/sec.
diff --git a/checks/ibm_svc_systemstats b/checks/ibm_svc_systemstats
new file mode 100644
index 0000000..13a0ceb
--- /dev/null
+++ b/checks/ibm_svc_systemstats
@@ -0,0 +1,120 @@
+#!/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_systemstats:sep(58)>>>
+# compression_cpu_pc:0:0:140325134929
+# cpu_pc:2:2:140325134929
+# fc_mb:640:1482:140325134754
+# fc_io:46718:56258:140325134749
+# sas_mb:0:0:140325134929
+# sas_io:0:0:140325134929
+# iscsi_mb:0:0:140325134929
+# iscsi_io:0:0:140325134929
+# write_cache_pc:0:1:140325134819
+# total_cache_pc:70:75:140325134704
+# vdisk_mb:207:533:140325134754
+# vdisk_io:4827:5966:140325134819
+# vdisk_ms:1:2:140325134759
+# mdisk_mb:222:651:140325134754
+# mdisk_io:4995:6741:140325134754
+# mdisk_ms:1:3:140325134809
+# drive_mb:0:0:140325134929
+# drive_io:0:0:140325134929
+# drive_ms:0:0:140325134929
+# vdisk_r_mb:113:428:140325134524
+# vdisk_r_io:2470:3672:140325134819
+# vdisk_r_ms:1:4:140325134759
+# vdisk_w_mb:93:143:140325134704
+# vdisk_w_io:2359:3595:140325134859
+# vdisk_w_ms:0:2:140325134704
+# mdisk_r_mb:32:362:140325134754
+# mdisk_r_io:1452:2825:140325134754
+# mdisk_r_ms:4:7:140325134649
+# mdisk_w_mb:189:291:140325134749
+# mdisk_w_io:3542:4465:140325134714
+# mdisk_w_ms:0:2:140325134819
+# drive_r_mb:0:0:140325134929
+# drive_r_io:0:0:140325134929
+# drive_r_ms:0:0:140325134929
+# drive_w_mb:0:0:140325134929
+# drive_w_io:0:0:140325134929
+# drive_w_ms:0:0:140325134929
+
+
+# parses agent output into a structure like:
+# {'Drives': {'r_mb': 0, 'w_mb': 0},
+# 'MDisks': {'r_mb': 32, 'w_mb': 189},
+# 'VDisks': {'r_mb': 113, 'w_mb': 93}}
+
+def ibm_svc_systemstats_parse(info):
+ parsed = {}
+ for stat_name, stat_current, stat_peak, stat_peak_time in info:
+ if stat_name in ("vdisk_r_mb", "vdisk_w_mb"):
+ if "VDisks" not in parsed.keys():
+ parsed["VDisks"] = {}
+ stat_name = stat_name.replace("vdisk_", "")
+ parsed["VDisks"][stat_name] = int(stat_current)
+ if stat_name in ("mdisk_r_mb", "mdisk_w_mb"):
+ if "MDisks" not in parsed.keys():
+ parsed["MDisks"] = {}
+ stat_name = stat_name.replace("mdisk_", "")
+ parsed["MDisks"][stat_name] = int(stat_current)
+ if stat_name in ("drive_r_mb", "drive_w_mb"):
+ if "Drives" not in parsed.keys():
+ parsed["Drives"] = {}
+ stat_name = stat_name.replace("drive_", "")
+ parsed["Drives"][stat_name] = int(stat_current)
+ return parsed
+
+def inventory_ibm_svc_systemstats(info):
+ inventory = []
+ parsed = ibm_svc_systemstats_parse(info)
+ for key in parsed.keys():
+ inventory.append( (key, None) )
+ return inventory
+
+def check_ibm_svc_systemstats(item, _no_params, info):
+ parsed = ibm_svc_systemstats_parse(info)
+
+ if item not in parsed.keys():
+ return 3, "%s not found in agent output" % item
+
+ read_bytes = parsed[item]['r_mb'] * 1024 * 1024
+ write_bytes = parsed[item]['w_mb'] * 1024 * 1024
+ perfdata = [ ("read", read_bytes), ("write", write_bytes) ]
+
+ return 0, "%s/sec read, %s/sec write" % \
+ (get_bytes_human_readable(read_bytes), get_bytes_human_readable(write_bytes)), \
+ perfdata
+
+check_info["ibm_svc_systemstats.diskio"] = {
+ "check_function" : check_ibm_svc_systemstats,
+ "inventory_function" : inventory_ibm_svc_systemstats,
+ "service_description" : "IBM SVC Throughput %s Total",
+ "has_perfdata" : True,
+}
+
diff --git a/pnp-templates/check_mk-ibm_svc_systemstats.diskio.php
b/pnp-templates/check_mk-ibm_svc_systemstats.diskio.php
new file mode 120000
index 0000000..8b45325
--- /dev/null
+++ b/pnp-templates/check_mk-ibm_svc_systemstats.diskio.php
@@ -0,0 +1 @@
+check_mk-diskstat.php
\ No newline at end of file
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 5bdf83e..fb7a1e9 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -533,6 +533,7 @@ perfometers["check_mk-mysql.innodb_io"] =
perfometer_check_mk_diskstat
perfometers["check_mk-esx_vsphere_counters.diskio"] =
perfometer_check_mk_diskstat
perfometers["check_mk-emcvnx_disks"] = perfometer_check_mk_diskstat
perfometers["check_mk-ibm_svc_nodestats.diskio"] =
perfometer_check_mk_diskstat
+perfometers["check_mk-ibm_svc_systemstats.diskio"] =
perfometer_check_mk_diskstat
def perfometer_in_out_mb_per_sec(row, check_command, perf_data):
read_mbit = float(perf_data[0][1]) / 131072
diff --git a/web/plugins/wato/datasource_programs.py
b/web/plugins/wato/datasource_programs.py
index 6a29d60..90f9077 100644
--- a/web/plugins/wato/datasource_programs.py
+++ b/web/plugins/wato/datasource_programs.py
@@ -272,12 +272,10 @@ register_rule(group,
( "lsnode", _("IO Groups") ),
( "lsnodestats", _("Node Stats") ),
( "lssystem", _("System Info") ),
-# ( "lssystemstats", _("System Stats") ),
+ ( "lssystemstats", _("System Stats") ),
],
-# default_value = [ "lshost", "lslicense",
"lsmdisk", "lsmdiskgrp", "lsnode",
-# "lsnodestats", "lssystem",
"lssystemstats", ],
default_value = [ "lshost", "lslicense",
"lsmdisk", "lsmdiskgrp", "lsnode",
- "lsnodestats", "lssystem", ],
+ "lsnodestats", "lssystem",
"lssystemstats", ],
allow_empty = False,
),
title = _("Retrieve information about..."),