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
+
+
Module: check_mk
Branch: master
Commit: 9bd941fc9957b761332203f8830cb957f7d97cf5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9bd941fc9957b7…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jul 20 15:51:48 2012 +0200
vms_cpu: new check for CPU utilization on OpenVMS
---
ChangeLog | 1 +
checkman/vms_cpu | 28 +++++++++++++++
checks/vms_cpu | 66 ++++++++++++++++++++++++++++++++++++
pnp-templates/check_mk-vms_cpu.php | 1 +
web/plugins/perfometer/check_mk.py | 1 +
5 files changed, 97 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 413d8c9..896a24e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@
* vms_diskstat.df: new check file usage of OpenVMS disks (agent will
come shortly after)
* vms_users: new check for number of interactive sessions on OpenVMS
+ * vms_cpu: new check for CPU utilization on OpenVMS
WATO:
* Added permission to control the "clone host" feature in WATO
diff --git a/checkman/vms_cpu b/checkman/vms_cpu
new file mode 100644
index 0000000..0880cf1
--- /dev/null
+++ b/checkman/vms_cpu
@@ -0,0 +1,28 @@
+title: Check CPU utilization (usage) and IO-Wait
+agents: openvms
+author: Mathias Kettner <mk(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ Check CPU utilization (user, system, idle) and IO-Wait on an
+ OpenVMS system. The number of CPUs is taken into account so that
+ maximum percentage is 100% is refers to the total CPUs available.
+
+ A level can be set only on {wait} (disk wait).
+
+perfdata:
+ Three variables: The percentage of time spent in {user}, {system} and {wait}
+ (disk wait). The idle time can be computed by substracting those three values
+ from 100%. The user value contains also {nice}.
+
+inventory:
+ One check per host is created for OpenVMS systems.
+
+[parameters]
+warning (int): The percentage of {wait} that triggers a warning level.
+critical (int): The percentage of {wait} that triggers a critical level
+ The parameters may also be set to {None}, which makes the check alwas {OK}.
+
+[configuration]
+vms_cpu_default_levels (int, int): Default levels used by inventorized
+ checks. This is present to {None}, which disables the levels.
diff --git a/checks/vms_cpu b/checks/vms_cpu
new file mode 100644
index 0000000..9e2b862
--- /dev/null
+++ b/checks/vms_cpu
@@ -0,0 +1,66 @@
+#!/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.
+
+vms_cpu_default_levels = None
+
+# Example output from agent:
+# <<<vms_cpu>>>
+# 1 99.17 0.54 0.18 0.00
+
+
+def inventory_vms_cpu(info):
+ if len(info) > 0:
+ return [(None, "vms_cpu_default_levels")]
+
+def check_vms_cpu(item, params, info):
+ num_cpus = int(info[0][0])
+ idle, user, wait_interrupt, wait_npsync = map(lambda x: float(x) / num_cpus, info[0][1:])
+ wait = wait_interrupt + wait_npsync
+ system = 100.0 - idle - user - wait
+ infotext = " - user: %2.1f%%, system: %2.1f%%, wait: %2.1f%%" % (user, system, wait)
+ state = 0
+ if params:
+ warn, crit = params
+ if wait >= crit:
+ state = 2
+ infotext += '(!!)'
+ elif wait >= warn:
+ state = 1
+ infotext += '(!)'
+
+ perfdata = [
+ ( "user", user ),
+ ( "system", system ),
+ ( "wait", wait, warn, crit ) ]
+ return (state, nagios_state_names[state] + infotext, perfdata)
+
+check_info['vms_cpu'] = {
+ "check_function" : check_vms_cpu,
+ "inventory_function" : inventory_vms_cpu,
+ "service_description" : "CPU utilization",
+ "has_perfdata" : True,
+ "group" : "cpu_iowait",
+}
diff --git a/pnp-templates/check_mk-vms_cpu.php b/pnp-templates/check_mk-vms_cpu.php
new file mode 120000
index 0000000..16648b1
--- /dev/null
+++ b/pnp-templates/check_mk-vms_cpu.php
@@ -0,0 +1 @@
+check_mk-kernel.util.php
\ No newline at end of file
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 05dad5b..1faf690 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -84,6 +84,7 @@ def perfometer_check_mk_kernel_util(row, check_command, perf_data):
perfometers["check_mk-kernel.util"] = perfometer_check_mk_kernel_util
perfometers["check_mk-vms_sys.util"] = perfometer_check_mk_kernel_util
+perfometers["check_mk-vms_cpu"] = perfometer_check_mk_kernel_util
perfometers["check_mk-ucd_cpu_util"] = perfometer_check_mk_kernel_util
perfometers["check_mk-lparstat_aix.cpu_util"] = perfometer_check_mk_kernel_util
Module: check_mk
Branch: master
Commit: 271445ad3ba23fe14e570c57e9912fe7a5d79a84
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=271445ad3ba23f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jul 20 15:27:24 2012 +0200
vms_users: new check for number of interactive sessions on OpenVMS
---
ChangeLog | 1 +
checkman/vms_users | 11 +++++++++
checks/vms_users | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 75 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ef2d041..413d8c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@
jmx4perl). You need the new plugin mk_jokokia for using them
* vms_diskstat.df: new check file usage of OpenVMS disks (agent will
come shortly after)
+ * vms_users: new check for number of interactive sessions on OpenVMS
WATO:
* Added permission to control the "clone host" feature in WATO
diff --git a/checkman/vms_users b/checkman/vms_users
new file mode 100644
index 0000000..7af0d4f
--- /dev/null
+++ b/checkman/vms_users
@@ -0,0 +1,11 @@
+title: Monitor interactively logged in users in OpenVMS
+agents: openvms
+author: Mathias Kettner <mk(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check is always OK and lists all interactively logged in users
+ with their current number of sessions.
+
+perfdata:
+ One integer value: the total number of interactive sessions.
diff --git a/checks/vms_users b/checks/vms_users
new file mode 100644
index 0000000..ce2ff92
--- /dev/null
+++ b/checks/vms_users
@@ -0,0 +1,63 @@
+#!/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:
+# <<<vms_users>>>
+# AEP 2 - - 1
+# SYSTEM 1
+# TCPIP$FTP - - - 1
+
+
+def inventory_vms_users(info):
+ if len(info) > 0:
+ return [(None, {})]
+
+def check_vms_users(item, params, info):
+
+ infos = []
+ num_sessions = 0
+ for line in info:
+ # complete missing columns
+ line += ['-'] * (5-len(line))
+ interactive, subproc, batch, network = map(saveint, line[1:])
+ if interactive:
+ num_sessions += interactive
+ infos.append(("%s: %d" % (line[0], interactive)))
+
+ perfdata = [("sessions", num_sessions)]
+
+ if num_sessions:
+ return (0, "OK - Interactive users: " + ", ".join(infos), perfdata)
+ else:
+ return (0, "OK - No interactive users", perfdata)
+
+
+check_info['vms_users'] = {
+ "check_function" : check_vms_users,
+ "inventory_function" : inventory_vms_users,
+ "service_description" : "VMS Users",
+ "has_perfdata" : True,
+}