Module: check_mk
Branch: master
Commit: 638efe913a14e63d4f3f19fa00b4df474b14d288
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=638efe913a14e6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jul 20 17:26:14 2012 +0200
vms_system.procs: new check for number of processes on OpenVMS
---
ChangeLog | 1 +
checkman/vms_system.procs | 19 +++++++++++++++++++
checks/cpu | 2 +-
checks/vms_system | 22 ++++++++++++++++++++++
pnp-templates/check_mk-vms_system.procs.php | 1 +
web/plugins/perfometer/check_mk.py | 5 +++++
web/plugins/wato/check_parameters.py | 17 +++++++++++++++--
7 files changed, 64 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 32178ed..0bf8111 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,7 @@
* 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
+ * vms_system.procs: new check for number of processes on OpenVMS
WATO:
* Added permission to control the "clone host" feature in WATO
diff --git a/checkman/vms_system.procs b/checkman/vms_system.procs
new file mode 100644
index 0000000..56e6966
--- /dev/null
+++ b/checkman/vms_system.procs
@@ -0,0 +1,19 @@
+title: Check number of processes on OpenVMS
+agents: openvms
+author: Mathias Kettner <mk(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check measures the number of existing (not neccessarily
+ running) processes on OpenVMS. You can set levels on the number.
+
+perfdata:
+ One value: the number of processes.
+
+inventory:
+ One check per OpenVMS system will be created.
+
+[parameters]
+warn(int): warning level for the number of processes
+crit(int): critical level for the number of processes
+
diff --git a/checks/cpu b/checks/cpu
index ea3198e..480a86c 100644
--- a/checks/cpu
+++ b/checks/cpu
@@ -70,7 +70,7 @@ def check_cpu_threads(item, params, info):
if nthreads >= crit:
return (2, "CRIT - %d threads (critical at %d)" % (nthreads, crit),
perfdata)
elif nthreads >= warn:
- return (1, "WARN - %d threads (warning %d)" % (nthreads, warn),
perfdata)
+ return (1, "WARN - %d threads (warning at %d)" % (nthreads, warn),
perfdata)
else:
return (0, "OK - %d threads" % (nthreads,), perfdata)
diff --git a/checks/vms_system b/checks/vms_system
index cbf18bb..3f77288 100644
--- a/checks/vms_system
+++ b/checks/vms_system
@@ -48,3 +48,25 @@ check_info["vms_system.ios"] = {
"service_description" : "IOs",
"has_perfdata" : True,
}
+
+def check_vms_system_procs(_no_item, params, info):
+ procs = int(float(info[0][2]))
+ if params:
+ warn, crit = params
+ perfdata = [('procs', procs, warn, crit, 0 )]
+ if procs >= crit:
+ return (2, "CRIT - %d processes (critical at %d)" % (procs, crit),
perfdata)
+ elif procs >= warn:
+ return (1, "WARN - %d processes (warning at %d)" % (procs, warn),
perfdata)
+ else:
+ return (0, "OK - %d processes" % (procs,), perfdata)
+
+
+check_info["vms_system.procs"] = {
+ "check_function" : check_vms_system_procs,
+ "inventory_function" : inventory_vms_system,
+ "service_description" : "Number of processes",
+ "has_perfdata" : True,
+ "group" : "vms_procs",
+}
+
diff --git a/pnp-templates/check_mk-vms_system.procs.php
b/pnp-templates/check_mk-vms_system.procs.php
new file mode 120000
index 0000000..559cd5e
--- /dev/null
+++ b/pnp-templates/check_mk-vms_system.procs.php
@@ -0,0 +1 @@
+check_mk-cpu.threads.php
\ No newline at end of file
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 818a397..0ff9d66 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -537,3 +537,8 @@ def perfometer_vms_system_ios(row, check_command, perf_data):
perfometers["check_mk-vms_system.ios"] = perfometer_vms_system_ios
+def perfometer_check_mk_vms_system_procs(row, check_command, perf_data):
+ color = { 0: "#a4f", 1: "#ff2", 2: "#f22", 3:
"#fa2" }[row["service_state"]]
+ return "%d" % int(perf_data[0][1]), perfometer_logarithmic(perf_data[0][1],
100, 2, color)
+
+perfometers["check_mk-vms_system.procs"] =
perfometer_check_mk_vms_system_procs
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index e319296..68ee915 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1215,8 +1215,21 @@ checkgroups.append((
help = _("These levels check the number of currently existing threads on
the system. Each process has at "
"least one thread."),
elements = [
- Integer(title = _("Warning at"), label =
_("threads")),
- Integer(title = _("Critical at"), label =
_("threads"))]),
+ Integer(title = _("Warning at"), unit = _("threads"),
default_value = 1000),
+ Integer(title = _("Critical at"), unit = _("threads"),
default_value = 2000)]),
+ None, None))
+
+checkgroups.append((
+ subgroup_applications,
+ "vms_procs",
+ _("Number of processes on OpenVMS"),
+ Optional(
+ Tuple(
+ elements = [
+ Integer(title = _("Warning at"), unit =
_("processes"), default_value = 100),
+ Integer(title = _("Critical at"), unit =
_("processes"), default_value = 200)]),
+ title = _("Impose levels on number of processes"),
+ ),
None, None))
checkgroups.append((