GUI CSS: Removed snapin styles from py modules and added a _snapins.scss for the...
[check_mk.git] / checks / arbor_peakflow_tms
blob8abd35d9b0a58e6998f3905d1cdfca4669819430
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
10 # | Copyright Mathias Kettner 2015 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 # .1.3.6.1.4.1.9694.1.5.2.1.0 No Fault --> PEAKFLOW-TMS-MIB::tmsHostFault.0
28 # .1.3.6.1.4.1.9694.1.5.2.2.0 101420100 --> PEAKFLOW-TMS-MIB::tmsHostUpTime.0
29 # .1.3.6.1.4.1.9694.1.5.2.3.0 46 --> PEAKFLOW-TMS-MIB::deviceCpuLoadAvg1min.0
30 # .1.3.6.1.4.1.9694.1.5.2.4.0 64 --> PEAKFLOW-TMS-MIB::deviceCpuLoadAvg5min.0
31 # .1.3.6.1.4.1.9694.1.5.2.5.0 67 --> PEAKFLOW-TMS-MIB::deviceCpuLoadAvg15min.0
32 # .1.3.6.1.4.1.9694.1.5.2.6.0 6 --> PEAKFLOW-TMS-MIB::deviceDiskUsage.0
33 # .1.3.6.1.4.1.9694.1.5.2.7.0 4 --> PEAKFLOW-TMS-MIB::devicePhysicalMemoryUsage.0
34 # .1.3.6.1.4.1.9694.1.5.2.8.0 0 --> PEAKFLOW-TMS-MIB::deviceSwapSpaceUsage.0
37 def parse_peakflow_tms(info):
38 health = info[0][0]
39 updates = info[1][0]
40 return {
41 'cpu_loads': health[:3],
42 'disk': health[3],
43 'memory': health[4:6],
44 'host_fault': health[6],
45 'update': {
46 "Device": updates[0],
47 "Mitigation": updates[1]
52 check_info["arbor_peakflow_tms"] = {
53 "check_function": check_arbor_memory,
54 "inventory_function": inventory_arbor_memory,
55 "parse_function": parse_peakflow_tms,
56 "service_description": "Memory",
57 "has_perfdata": True,
58 "group": "memory_arbor",
59 'default_levels_variable': 'arbor_memory_default_levels',
60 "snmp_info": [
62 ".1.3.6.1.4.1.9694.1.5.2",
64 "3.0", # deviceCpuLoadAvg1min
65 "4.0", # deviceCpuLoadAvg5min
66 "5.0", # deviceCpuLoadAvg15min
67 "6.0", # deviceDiskUsage
68 "7.0", # devicePhysicalMemoryUsage
69 "8.0", # deviceSwapSpaceUsage
70 "1.0", # tmsHostFault
71 ]),
73 ".1.3.6.1.4.1.9694.1.5.5",
75 "1.2.0", # tmsLastUpdate
76 "2.1.0", # tmsMitigationLastUpdate
79 "snmp_scan_function": lambda oid: oid(".1.3.6.1.2.1.1.1.0").startswith("Peakflow"),
80 "includes": ["arbor.include"],
83 check_info["arbor_peakflow_tms.cpu_load"] = {
84 "check_function": check_arbor_cpu_load,
85 "inventory_function": inventory_arbor_cpu_load,
86 "service_description": "CPU load",
87 "has_perfdata": True,
88 "group": "cpu_load",
89 "includes": ["cpu_load.include"],
92 check_info["arbor_peakflow_tms.disk_usage"] = {
93 "check_function": check_arbor_disk_usage,
94 "inventory_function": inventory_arbor_disk_usage,
95 "service_description": "Disk Usage %s",
96 "has_perfdata": True,
97 "group": "filesystem",
98 "default_levels_variable": "filesystem_default_levels",
101 check_info["arbor_peakflow_tms.host_fault"] = {
102 "check_function": check_arbor_host_fault,
103 "inventory_function": inventory_arbor_host_fault,
104 "service_description": "Host Fault",
108 def inventory_peakflow_tms_updates(parsed):
109 for name in parsed['update']:
110 yield name, None
113 def check_peakflow_tms_updates(item, no_params, parsed):
114 if item in parsed['update']:
115 return 0, parsed['update'][item]
118 check_info["arbor_peakflow_tms.updates"] = {
119 "check_function": check_peakflow_tms_updates,
120 "inventory_function": inventory_peakflow_tms_updates,
121 "service_description": "Config Update %s",