Refactoring: Changed remaining check parameters starting with an 's' to the new rules...
[check_mk.git] / checks / domino_tasks
blob015b46f3b98cbab85a1ae2d10b3384af99bfcfc6
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 SNMP walk:
29 # InTaskName: The actual name of the task as it appears in the SERVER.TASK statistic on the server.
30 # .1.3.6.1.4.1.334.72.1.1.6.1.2.1.4.0 Router
31 # .1.3.6.1.4.1.334.72.1.1.6.1.2.1.4.1 tm_grab Subsystems
32 # .1.3.6.1.4.1.334.72.1.1.6.1.2.1.4.2 tm_grab M01
33 # .1.3.6.1.4.1.334.72.1.1.6.1.2.1.4.3 tm_grab M02
34 # .1.3.6.1.4.1.334.72.1.1.6.1.2.1.4.4 tm_grab M03
35 # .1.3.6.1.4.1.334.72.1.1.6.1.2.1.4.5 tm_grab M04
36 # .1.3.6.1.4.1.334.72.1.1.6.1.2.1.4.6 tm_grab M05
37 # .1.3.6.1.4.1.334.72.1.1.6.1.2.1.4.7 tm_grab
38 # .1.3.6.1.4.1.334.72.1.1.6.1.2.1.4.8 Router
40 inv_domino_tasks_rules = []
41 inv_domino_tasks = []
44 # Bring the SNMP data in the format expected by the common ps functions.
45 # e.g.:
46 # [None, (u'root', u'185292', u'5804', u'00:00:02/03:33:13', u'1'), u'/sbin/init', u'splash']
47 def parse_domino_tasks(info):
48 parsed = []
49 for line in info:
50 node, task_name = line
51 # node, process_info, command_line
52 parsed.append((node, (None,), task_name))
53 return parsed
56 def inventory_domino_tasks(parsed):
57 return inventory_ps_common(inv_domino_tasks, inv_domino_tasks_rules, parsed)
60 def check_domino_tasks(item, params, parsed):
61 return check_ps_common(item, params, parsed, info_name="Tasks")
64 check_info['domino_tasks'] = {
65 "parse_function": parse_domino_tasks,
66 "check_function": check_domino_tasks,
67 "inventory_function": inventory_domino_tasks,
68 "has_perfdata": True,
69 "group": "domino_tasks",
70 "service_description": "Domino Task %s",
71 "includes": ["ps.include"],
72 "node_info": True, # add first column with actual host name
73 "snmp_scan_function": lambda oid: oid(".1.3.6.1.2.1.1.2.0") == ".1.3.6.1.4.1.311.1.1.3.1.2",
74 "snmp_info": (
75 ".1.3.6.1.4.1.334.72.1.1.6.1.2.1",
77 4, # InTaskName
78 ]),