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,
+}