Module: check_mk
Branch: master
Commit: e24f036c853d617bcea1306ef35e168d928a7e28
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e24f036c853d61…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jul 20 17:02:08 2012 +0200
vms_system.ios: new check for total direct/buffered IOs on OpenVMS
---
ChangeLog | 1 +
checkman/vms_system.ios | 15 +++++++++
checks/vms_system | 50 +++++++++++++++++++++++++++++
pnp-templates/check_mk-vms_system.ios.php | 40 +++++++++++++++++++++++
web/plugins/perfometer/check_mk.py | 13 +++++++
5 files changed, 119 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0c6cf05..32178ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,7 @@
* vms_users: new check for number of interactive sessions on OpenVMS
* vms_cpu: new check for CPU utilization on OpenVMS
* vms_if: new check for network interfaces on OpenVMS
+ * vms_system.ios: new check for total direct/buffered IOs on OpenVMS
WATO:
* Added permission to control the "clone host" feature in WATO
diff --git a/checkman/vms_system.ios b/checkman/vms_system.ios
new file mode 100644
index 0000000..865e464
--- /dev/null
+++ b/checkman/vms_system.ios
@@ -0,0 +1,15 @@
+title: Monitor number total IOs of a node on OpenVMS
+agents: openvms
+author: Mathias Kettner <mk(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This checks measures the number of total direct and buffered IOs
+ on an OpenVMS host. The check is always OK.
+
+perfdata:
+ Two values: the number of direct and bufferd IOs per second.
+
+inventory:
+ One check per OpenVMS host will be created.
+
diff --git a/checks/vms_system b/checks/vms_system
new file mode 100644
index 0000000..cbf18bb
--- /dev/null
+++ b/checks/vms_system
@@ -0,0 +1,50 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2012 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
+# Columns:
+# 1. Direct IOs / sec (on hardware)
+# 2. Buffered IOs / sec (queued)
+# 3. Number of currently existing processes (averaged)
+
+# <<<vms_system>>>
+# 0.00 0.00 15.00
+
+def inventory_vms_system(info):
+ if len(info) > 0:
+ return [(None, None)]
+
+def check_vms_system_ios(_no_item, _no_params, info):
+ direct_ios, buffered_ios = map(float, info[0][:2])
+ return (0, "OK - Direct IOs: %.2f/sec, Buffered IOs: %.2f/sec" % (
+ direct_ios, buffered_ios), [ ("direct", direct_ios),
("buffered", buffered_ios)])
+
+check_info["vms_system.ios"] = {
+ "check_function" : check_vms_system_ios,
+ "inventory_function" : inventory_vms_system,
+ "service_description" : "IOs",
+ "has_perfdata" : True,
+}
diff --git a/pnp-templates/check_mk-vms_system.ios.php
b/pnp-templates/check_mk-vms_system.ios.php
new file mode 100644
index 0000000..c9a300f
--- /dev/null
+++ b/pnp-templates/check_mk-vms_system.ios.php
@@ -0,0 +1,40 @@
+<?php
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2012 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.
+
+$opt[1] = "--vertical-label 'IOs per second' -l0 --title \"IOs on
$hostname\" ";
+$def[1] = ""
+ . "DEF:direct=$RRDFILE[1]:$DS[1]:MAX "
+ . "AREA:direct#38808f:\"Direct IOs/sec \" "
+ . "GPRINT:direct:LAST:\"last\: %8.0lf/s\" "
+ . "GPRINT:direct:AVERAGE:\"avg\: %8.0lf/s\" "
+ . "GPRINT:direct:MAX:\"max\: %8.0lf/s\\n\" "
+
+ . "DEF:buffered=$RRDFILE[2]:$DS[2]:MAX "
+ . "AREA:buffered#38b0cf:\"Buffered IOs/sec\":STACK "
+ . "GPRINT:buffered:LAST:\"last\: %8.0lf/s\" "
+ . "GPRINT:buffered:AVERAGE:\"avg\: %8.0lf/s\" "
+ . "GPRINT:buffered:MAX:\"max\: %8.0lf/s\\n\" "
+ ;
+?>
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 8bdd0f1..818a397 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -524,3 +524,16 @@ def perfometer_mysql_capacity(row, check_command, perf_data):
return "%s" % number_human_readable(size), perfometer_logarithmic(size,
median, 10, color)
perfometers['check_mk-mysql_capacity'] = perfometer_mysql_capacity
+
+def perfometer_vms_system_ios(row, check_command, perf_data):
+ h = '<div class="stacked">'
+ direct = float(perf_data[0][1])
+ buffered = float(perf_data[1][1])
+ h += perfometer_logarithmic(buffered, 10000, 3, "#38b0cf")
+ h += perfometer_logarithmic(direct, 10000, 3, "#38808f")
+ h += '</div>'
+ return "%.0f / %.0f" % (direct, buffered), h # perfometer_logarithmic(100,
200, 2, "#883875")
+
+perfometers["check_mk-vms_system.ios"] = perfometer_vms_system_ios
+
+