Refactoring: Moved check parameters from unsorted.py to dedicated modules (CMK-1393)
[check_mk.git] / checks / vms_system
blob8df4e5b4251514b1c070e5ccd56835df76c09071
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
10 # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
11 # +------------------------------------------------------------------+
13 # This file is part of Check_MK.
14 # The official homepage is at http://mathias-kettner.de/check_mk.
16 # check_mk is free software; you can redistribute it and/or modify it
17 # under the terms of the GNU General Public License as published by
18 # the Free Software Foundation in version 2. check_mk is distributed
19 # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
20 # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
21 # PARTICULAR PURPOSE. See the GNU General Public License for more de-
22 # tails. You should have received a copy of the GNU General Public
23 # License along with GNU Make; see the file COPYING. If not, write
24 # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
25 # Boston, MA 02110-1301 USA.
27 # Example output from agent
28 # Columns:
29 # 1. Direct IOs / sec (on hardware)
30 # 2. Buffered IOs / sec (queued)
31 # 3. Number of currently existing processes (averaged)
33 # <<<vms_system>>>
34 # 0.00 0.00 15.00
37 def inventory_vms_system(info):
38 if len(info) > 0:
39 return [(None, None)]
42 def check_vms_system_ios(_no_item, _no_params, info):
43 direct_ios, buffered_ios = map(float, info[0][:2])
44 return (0, "Direct IOs: %.2f/sec, Buffered IOs: %.2f/sec" % (direct_ios, buffered_ios),
45 [("direct", direct_ios), ("buffered", buffered_ios)])
48 check_info["vms_system.ios"] = {
49 "check_function": check_vms_system_ios,
50 "inventory_function": inventory_vms_system,
51 "service_description": "IOs",
52 "has_perfdata": True,
56 def check_vms_system_procs(_no_item, params, info):
57 procs = int(float(info[0][2]))
58 perfdata = [('procs', procs, 0, 0, 0)]
60 if params:
61 warn, crit = params
62 perfdata = [('procs', procs, warn, crit, 0)]
63 if procs >= crit:
64 return (2, "%d processes (critical at %d)" % (procs, crit), perfdata)
65 elif procs >= warn:
66 return (1, "%d processes (warning at %d)" % (procs, warn), perfdata)
68 return (0, "%d processes" % (procs,), perfdata)
71 check_info["vms_system.procs"] = {
72 "check_function": check_vms_system_procs,
73 "inventory_function": inventory_vms_system,
74 "service_description": "Number of processes",
75 "has_perfdata": True,
76 "group": "vms_procs",