Disentangled Livestatus Proxy and socket connection settings
[check_mk.git] / checks / juniper_temp
blob30db060773d5dfd5f86d62859df20becd0767b48
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.2636.3.1.13.1.5.7.1.0.0 FPC: EX3300 48-Port @ 0/*/* --> SNMPv2-SMI::enterprises.2636.3.1.13.1.5.7.1.0.0
28 # .1.3.6.1.4.1.2636.3.1.13.1.5.7.2.0.0 FPC: EX3300 48-Port @ 1/*/* --> SNMPv2-SMI::enterprises.2636.3.1.13.1.5.7.2.0.0
29 # .1.3.6.1.4.1.2636.3.1.13.1.7.7.1.0.0 45 --> SNMPv2-SMI::enterprises.2636.3.1.13.1.7.7.1.0.0
30 # .1.3.6.1.4.1.2636.3.1.13.1.7.7.2.0.0 43 --> SNMPv2-SMI::enterprises.2636.3.1.13.1.7.7.2.0.0
32 factory_settings["juniper_temp_default_levels"] = {
33 "levels": (55, 60), # Just an assumption based on observed real temperatures
37 def parse_juniper_temp(info):
38 parsed = {}
39 for description, reading_str in info:
40 temperature = float(reading_str)
41 if temperature > 0:
42 description = description.replace(":", "") \
43 .replace("/*", "") \
44 .replace("@ ", "") \
45 .strip()
46 parsed[description] = temperature
47 return parsed
50 def inventory_juniper_temp(parsed):
51 return [(description, {}) for description in parsed]
54 def check_juniper_temp(item, params, parsed):
55 if item in parsed:
56 return check_temperature(parsed[item], params, "juniper_temp_%s" % item)
59 check_info['juniper_temp'] = {
60 'parse_function': parse_juniper_temp,
61 'inventory_function': inventory_juniper_temp,
62 'check_function': check_juniper_temp,
63 'service_description': 'Temperature %s',
64 'has_perfdata': True,
65 "snmp_scan_function":
66 lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.2636.1.1.1.2"),
67 'snmp_info': (
68 ".1.3.6.1.4.1.2636.3.1.13.1",
70 "5.7", # jnxOperatingDescr
71 "7.7", # jnxOperatingTemp
72 ]),
73 'group': 'temperature',
74 'default_levels_variable': "juniper_temp_default_levels",
75 'includes': ["temperature.include"],