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 # .1.3.6.1.4.1.89.53.15.1.9.1 = INTEGER: 42
29 # .1.3.6.1.4.1.89.53.15.1.10.1 = INTEGER: ok(1)
31 # Temperature is in Celcius by default.
32 # Tested with Dell PowerConnect 5448 and 5424 models.
34 factory_settings
["dell_powerconnect_temp_default_values"] = {
39 def parse_dell_powerconnect_temp(info
):
41 temp_str
, dev_status
= info
[0]
42 except (IndexError, ValueError):
45 temp
= float(temp_str
)
51 '3': 'non operational',
52 }.get(dev_status
, "unknown[%s]" % dev_status
)
55 def inventory_dell_powerconnect_temp(checkname
, parsed
):
57 return [("Ambient", {})]
60 def check_dell_powerconnect_temp(_no_item
, params
, parsed
):
64 temp
, dev_state_readable
= parsed
65 if dev_state_readable
== "OK":
67 elif dev_state_readable
== "unavailable":
69 elif dev_state_readable
== "non operational":
75 return state
, "Status: %s" % dev_state_readable
76 return check_temperature(
77 temp
, params
, "dell_powerconnect", dev_status
=state
, dev_status_name
=dev_state_readable
)
80 check_info
["dell_powerconnect_temp"] = {
81 "parse_function": parse_dell_powerconnect_temp
,
82 "check_function": check_dell_powerconnect_temp
,
83 "inventory_function": inventory_dell_powerconnect_temp
,
84 "service_description": "Temperature %s",
85 "default_levels_variable": "dell_powerconnect_temp_default_values",
88 ".1.3.6.1.4.1.89.53.15.1",
90 "9", # RADLAN-Physicaldescription-MIB::rlPhdUnitEnvParamTempSensorValue
91 "10" # RADLAN-Physicaldescription-MIB::rlPhdUnitEnvParamTempSensorStatus
94 lambda oid
: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.674.10895"),
95 "group": "temperature",
96 "includes": ["temperature.include"]