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.
27 factory_settings
["dell_om_sensors_default_levels"] = {"levels": (50, 60)}
30 def dell_om_sensors_item(name
):
31 return name
.replace("Temp", "").strip()
34 def inventory_dell_om_sensors(info
):
37 yield dell_om_sensors_item(line
[3]), {}
40 def check_dell_om_sensors(item
, params
, info
):
46 for idx
, sensor_state
, reading
, location_name
, dev_crit
, dev_warn
, dev_warn_lower
, dev_crit_lower
in info
:
47 if item
== idx
or dell_om_sensors_item(location_name
) == item
:
48 sensor_state
= int(sensor_state
)
49 if sensor_state
in [1, 2, 10]:
50 return 2, "Sensor is: " + sensor_states
[sensor_state
]
52 temp
= int(reading
) / 10.0
54 dev_warn
, dev_crit
, dev_warn_lower
, dev_crit_lower
= \
55 [float(v
)/10 if v
else None for v
in [ dev_warn
, dev_crit
, dev_warn_lower
, dev_crit_lower
]]
57 return check_temperature(
60 "dell_om_sensors_%s" % item
,
61 dev_levels
=(dev_warn
, dev_crit
),
62 dev_levels_lower
=(dev_warn_lower
, dev_crit_lower
))
65 check_info
["dell_om_sensors"] = {
66 "check_function": check_dell_om_sensors
,
67 "inventory_function": inventory_dell_om_sensors
,
68 "service_description": "Temperature %s",
70 "group": "temperature",
71 # There is no other way to find out that openmanage is present.
72 "snmp_scan_function": scan_dell_om
,
74 ".1.3.6.1.4.1.674.10892.1.700.20.1",
80 '8', # ProbeLocationName
81 '10', # ProbeUpperCriticalThreshold',
82 '11', # ProbeUpperNonCriticalThreshold',
83 '12', # ProbeLowerNonCriticalThreshold',
84 '13', # ProbeLowerCriticalThreshold',
85 #'16.1', # ProbeDiscreteReading',
87 "includes": ["dell_om.include", "temperature.include"],
88 "default_levels_variable": "dell_om_sensors_default_levels"