2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
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.
28 def parse_avaya_88xx(info
):
29 parsed
= {"fanstate": [], "temp": []}
31 parsed
["fanstate"].append(line
[0])
32 parsed
["temp"].append(line
[1])
37 def inventory_avaya_88xx_fan(parsed
):
38 for idx
, _state
in enumerate(parsed
["fanstate"]):
42 def check_avaya_88xx_fan(item
, _no_params
, parsed
):
43 fans
= parsed
["fanstate"]
44 if len(fans
) < int(item
):
48 "1": ("Reported Unknown", 3),
52 text
, state
= map_fan_state
.get(fans
[int(item
)], (None, None))
59 factory_settings
["avaya_88xx_default_levels"] = {
64 def inventory_avaya_88xx(parsed
):
65 sensors
= parsed
["temp"]
66 for idx
, temp
in enumerate(sensors
):
71 def check_avaya_88xx(item
, params
, parsed
):
72 sensors
= parsed
["temp"]
73 if len(sensors
) < int(item
):
76 reading
= sensors
[int(item
)]
78 return check_temperature(int(reading
), params
, "avaya_88xx_%s" % item
)
81 check_info
["avaya_88xx"] = {
82 'parse_function': parse_avaya_88xx
,
83 'check_function': check_avaya_88xx
,
84 'inventory_function': inventory_avaya_88xx
,
85 'service_description': 'Temperature Fan %s',
86 'default_levels_variable': "avaya_88xx_default_levels",
88 'group': 'temperature',
90 'snmp_info': (".1.3.6.1.4.1.2272.1.4.7.1.1",
91 [2, 3]), # rcChasFanOperStatus, rcChasFanAmbientTemperature
92 'snmp_scan_function': lambda oid
: ".1.3.6.1.4.1.2272" in oid(".1.3.6.1.2.1.1.2.0"),
93 'includes': ['temperature.include'],
96 check_info
["avaya_88xx.fan"] = {
97 'check_function': check_avaya_88xx_fan
,
98 'inventory_function': inventory_avaya_88xx_fan
,
99 'service_description': 'Fan %s Status',