Refactoring: Moved check parameters from unsorted.py to dedicated modules (CMK-1393)
[check_mk.git] / checks / didactum_sensors_analog
blob59b2c459061e96916c5d2f3e9e66ab4f8c6732e6
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
10 # | Copyright Mathias Kettner 2016 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.46501.5.2.1.5.201001 Onboard Temperature --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogName.201001
28 # .1.3.6.1.4.1.46501.5.2.1.5.201002 Analog-1 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogName.201002
29 # .1.3.6.1.4.1.46501.5.2.1.5.201003 Analog-2 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogName.201003
30 # .1.3.6.1.4.1.46501.5.2.1.5.203001 Onboard Voltage DC --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogName.203001
31 # .1.3.6.1.4.1.46501.5.2.1.6.201001 normal --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogState.201001
32 # .1.3.6.1.4.1.46501.5.2.1.6.201002 normal --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogState.201002
33 # .1.3.6.1.4.1.46501.5.2.1.6.201003 normal --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogState.201003
34 # .1.3.6.1.4.1.46501.5.2.1.6.203001 normal --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogState.203001
35 # .1.3.6.1.4.1.46501.5.2.1.7.201001 28.9 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogValue.201001
36 # .1.3.6.1.4.1.46501.5.2.1.7.201002 22.8 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogValue.201002
37 # .1.3.6.1.4.1.46501.5.2.1.7.201003 21.1 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogValue.201003
38 # .1.3.6.1.4.1.46501.5.2.1.7.203001 12.4 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogValue.203001
39 # .1.3.6.1.4.1.46501.5.2.1.10.201001 0.0 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogLowAlarm.201001
40 # .1.3.6.1.4.1.46501.5.2.1.10.201002 13.0 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogLowAlarm.201002
41 # .1.3.6.1.4.1.46501.5.2.1.10.201003 13.0 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogLowAlarm.201003
42 # .1.3.6.1.4.1.46501.5.2.1.10.203001 9.0 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogLowAlarm.203001
43 # .1.3.6.1.4.1.46501.5.2.1.11.201001 5.0 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogLowWarning.201001
44 # .1.3.6.1.4.1.46501.5.2.1.11.201002 15.0 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogLowWarning.201002
45 # .1.3.6.1.4.1.46501.5.2.1.11.201003 15.0 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogLowWarning.201003
46 # .1.3.6.1.4.1.46501.5.2.1.11.203001 11.0 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogLowWarning.203001
47 # .1.3.6.1.4.1.46501.5.2.1.12.201001 45.0 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogHighWarning.201001
48 # .1.3.6.1.4.1.46501.5.2.1.12.201002 27.0 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogHighWarning.201002
49 # .1.3.6.1.4.1.46501.5.2.1.12.201003 27.0 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogHighWarning.201003
50 # .1.3.6.1.4.1.46501.5.2.1.12.203001 13.0 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogHighWarning.203001
51 # .1.3.6.1.4.1.46501.5.2.1.13.201001 50.0 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogHighAlarm.201001
52 # .1.3.6.1.4.1.46501.5.2.1.13.201002 29.0 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogHighAlarm.201002
53 # .1.3.6.1.4.1.46501.5.2.1.13.201003 29.0 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogHighAlarm.201003
54 # .1.3.6.1.4.1.46501.5.2.1.13.203001 14.0 --> DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogHighAlarm.203001
56 # .--temperature---------------------------------------------------------.
57 # | _ _ |
58 # | | |_ ___ _ __ ___ _ __ ___ _ __ __ _| |_ _ _ _ __ ___ |
59 # | | __/ _ \ '_ ` _ \| '_ \ / _ \ '__/ _` | __| | | | '__/ _ \ |
60 # | | || __/ | | | | | |_) | __/ | | (_| | |_| |_| | | | __/ |
61 # | \__\___|_| |_| |_| .__/ \___|_| \__,_|\__|\__,_|_| \___| |
62 # | |_| |
63 # +----------------------------------------------------------------------+
64 # | main check |
65 # '----------------------------------------------------------------------'
68 def inventory_didactum_sensors_analog_temp(parsed):
69 return inventory_didactum_sensors(parsed, "temperature")
72 check_info['didactum_sensors_analog'] = {
73 'parse_function': parse_didactum_sensors,
74 'inventory_function': inventory_didactum_sensors_analog_temp,
75 'check_function': check_didactum_sensors_temp,
76 'service_description': 'Temperature %s',
77 'snmp_info': (
78 '.1.3.6.1.4.1.46501.5.2.1',
80 "4", # DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogType
81 "5", # DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogName
82 "6", # DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogState
83 "7", # DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogValue
84 "10", # DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogLowAlarm
85 "11", # DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogLowWarning
86 "12", # DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogHighWarning
87 "13", # DIDACTUM-SYSTEM-MIB::ctlInternalSensorsAnalogHighAlarm
88 ]),
89 'snmp_scan_function': scan_didactum,
90 'has_perfdata': True,
91 'group': 'temperature',
92 'includes': ['temperature.include', 'didactum.include'],
96 # .--humidity------------------------------------------------------------.
97 # | _ _ _ _ _ |
98 # | | |__ _ _ _ __ ___ (_) __| (_) |_ _ _ |
99 # | | '_ \| | | | '_ ` _ \| |/ _` | | __| | | | |
100 # | | | | | |_| | | | | | | | (_| | | |_| |_| | |
101 # | |_| |_|\__,_|_| |_| |_|_|\__,_|_|\__|\__, | |
102 # | |___/ |
103 # '----------------------------------------------------------------------'
106 def inventory_didactum_sensors_analog_humid(parsed):
107 return inventory_didactum_sensors(parsed, "humidity")
110 check_info['didactum_sensors_analog.humidity'] = {
111 'inventory_function': inventory_didactum_sensors_analog_humid,
112 'check_function': check_didactum_sensors_humidity,
113 'service_description': 'Humidity %s',
114 'has_perfdata': True,
115 'group': 'humidity',
116 'includes': ['humidity.include', 'didactum.include'],
120 # .--voltage-------------------------------------------------------------.
121 # | _ _ |
122 # | __ _____ | | |_ __ _ __ _ ___ |
123 # | \ \ / / _ \| | __/ _` |/ _` |/ _ \ |
124 # | \ V / (_) | | || (_| | (_| | __/ |
125 # | \_/ \___/|_|\__\__,_|\__, |\___| |
126 # | |___/ |
127 # '----------------------------------------------------------------------'
130 def inventory_didactum_sensors_analog_volt(parsed):
131 return inventory_didactum_sensors(parsed, "voltage")
134 check_info['didactum_sensors_analog.voltage'] = {
135 'inventory_function': inventory_didactum_sensors_analog_volt,
136 'check_function': check_didactum_sensors_voltage,
137 'service_description': 'Phase %s',
138 'has_perfdata': True,
139 'group': 'el_inphase',
140 'includes': ['elphase.include', 'didactum.include'],