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.
51 "23": "Hard Disk Tray Fan 1",
52 "24": "Hard Disk Tray Fan 2",
56 def inventory_datapower_fan(info
):
57 for fan_id
, _speed
, _status
in info
:
58 yield datapower_fan_ids
[fan_id
], None
61 def check_datapower_fan(item
, _no_params
, info
):
62 datapower_fan_status
= {
63 "1": (2, "reached lower non-recoverable limit: "),
64 "2": (2, "reached lower critical limit: "),
65 "3": (1, "reached lower non-critical limit: "),
67 "5": (1, "reached upper non-critical limit: "),
68 "6": (2, "reached upper critical limit: "),
69 "7": (2, "reached upper non-recoverable limit: "),
70 "8": (2, "failure, "),
71 "9": (2, "no reading, "),
72 "10": (1, "invalid, "),
74 for fan_id
, speed
, status
in info
:
75 if item
== datapower_fan_ids
[fan_id
]:
76 state
, state_txt
= datapower_fan_status
[status
]
77 infotext
= "%s%s rpm" % (state_txt
, speed
)
78 return state
, infotext
81 check_info
["datapower_fan"] = {
82 "inventory_function": inventory_datapower_fan
,
83 "check_function": check_datapower_fan
,
84 "service_description": "Fan %s",
86 ".1.3.6.1.4.1.14685.3.1.97.1",
88 1, # dpStatusEnvironmentalFanSensorsFanID
89 2, # dpStatusEnvironmentalFanSensorsFanSpeed
90 4, # dpStatusEnvironmentalFanSensorsReadingStatus
92 "snmp_scan_function": lambda oid
: oid(".1.3.6.1.2.1.1.2.0") in
93 [".1.3.6.1.4.1.14685.1.7", ".1.3.6.1.4.1.14685.1.3"],