Refactoring: Changed all check parameters starting with an 'o' to the new rulespec...
[check_mk.git] / checks / ispro_sensors_temp
blob6eba6f493d339e055c5608b8404b1e23a1b7075c
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.19011.1.3.2.1.3.1.1.1.2.1 "Temperature-R" --> ISPRO-MIB::isDeviceMonitorTemperatureName
28 # .1.3.6.1.4.1.19011.1.3.2.1.3.1.1.1.3.1 2230 --> ISPRO-MIB::isDeviceMonitorTemperature
29 # .1.3.6.1.4.1.19011.1.3.2.1.3.1.1.1.4.1 3 --> ISPRO-MIB::isDeviceMonitorTemperatureAlarm
30 # .1.3.6.1.4.1.19011.1.3.2.1.3.2.2.1.3.1 2300 --> ISPRO-MIB::isDeviceConfigTemperatureLowWarning
31 # .1.3.6.1.4.1.19011.1.3.2.1.3.2.2.1.4.1 2000 --> ISPRO-MIB::isDeviceConfigTemperatureLowCritical
32 # .1.3.6.1.4.1.19011.1.3.2.1.3.2.2.1.5.1 3000 --> ISPRO-MIB::isDeviceConfigTemperatureHighWarning
33 # .1.3.6.1.4.1.19011.1.3.2.1.3.2.2.1.6.1 3800 --> ISPRO-MIB::isDeviceConfigTemperatureHighCritical
36 def inventory_ispro_sensors_temp(info):
37 return [(line[0], {}) for line in info if line[2] not in ["1", "2"]]
40 def check_ispro_sensors_temp(item, params, info):
41 for name, reading_str, status, warn_low, crit_low, warn, crit in info:
42 if item == name:
43 devstatus, devstatus_name = ispro_sensors_alarm_states(status)
44 return check_temperature(
45 float(reading_str) / 100.0,
46 params,
47 "ispro_sensors_temp_%s" % item,
48 dev_levels=(float(warn) / 100.0, float(crit) / 100.0),
49 dev_levels_lower=(float(warn_low) / 100.0, float(crit_low) / 100.0),
50 dev_status=devstatus,
51 dev_status_name=devstatus_name)
54 check_info['ispro_sensors_temp'] = {
55 'inventory_function': inventory_ispro_sensors_temp,
56 'check_function': check_ispro_sensors_temp,
57 'service_description': 'Temperature %s',
58 'snmp_info': (
59 '.1.3.6.1.4.1.19011.1.3.2.1.3',
61 "1.1.1.2", # ISPRO-MIB::isDeviceMonitorTemperatureName
62 "1.1.1.3", # ISPRO-MIB::isDeviceMonitorTemperature (unit is 0.01 degree)
63 "1.1.1.4", # ISPRO-MIB::isDeviceMonitorTemperatureAlarm
64 "2.2.1.3", # ISPRO-MIB::isDeviceConfigTemperatureLowWarning
65 "2.2.1.4", # ISPRO-MIB::isDeviceConfigTemperatureLowCritical
66 "2.2.1.5", # ISPRO-MIB::isDeviceConfigTemperatureHighWarning
67 "2.2.1.6", # ISPRO-MIB::isDeviceConfigTemperatureHighCritical
68 ]),
69 'snmp_scan_function': ispro_scan_function,
70 'has_perfdata': True,
71 'group': 'temperature',
72 'includes': ['ispro.include', 'temperature.include'],