2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
10 # | Copyright Mathias Kettner 2017 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.
30 def inventory_dell_idrac_power(info
):
31 for index
, _status
, _count
in info
[0]:
35 def check_dell_idrac_power(item
, _no_params
, info
):
42 "6": (0, "not redundant"),
43 "7": (1, "redundancy offline"),
46 for index
, status
, _count
in info
[0]:
48 state
, state_readable
= translate_status
[status
]
49 yield state
, "Status: %s" % state_readable
52 check_info
['dell_idrac_power'] = {
53 'inventory_function': inventory_dell_idrac_power
,
54 'check_function': check_dell_idrac_power
,
55 'service_description': 'Power Supply Redundancy %s',
58 '.1.3.6.1.4.1.674.10892.5.4.600.10.1',
60 "2", # IDRAC-MIB::powerUnitIndex
61 "5", # IDRAC-MIB::powerUnitRedundancyStatus
62 "6", # IDRAC-MIB::powerSupplyCountForRedundancy
65 '.1.3.6.1.4.1.674.10892.5.4.600.12.1',
67 "2", # IDRAC-MIB::powerSupplyIndex
68 "5", # IDRAC-MIB::powerSupplyStatus
69 "7", # IDRAC-MIB::powerSupplyType
70 "8", # IDRAC-MIB::powerSupplyLocationName
73 'snmp_scan_function': lambda oid
: oid('.1.3.6.1.2.1.1.2.0').startswith(
74 ".1.3.6.1.4.1.674.10892.5"),
78 def inventory_dell_idrac_power_unit(info
):
79 for index
, _status
, _psu_type
, _location
in info
[1]:
83 def check_dell_idrac_power_unit(item
, _no_params
, info
):
88 "4": (1, "NONCRITICAL"),
90 "6": (2, "NONRECOVERABLE"),
107 for index
, status
, psu_type
, location
in info
[1]:
109 state
, state_readable
= translate_status
[status
]
110 psu_type_readable
= translate_type
[psu_type
]
111 yield state
, "Status: %s, Type: %s, Name: %s" % \
112 ( state_readable
, psu_type_readable
, location
)
115 check_info
['dell_idrac_power.unit'] = {
116 'inventory_function': inventory_dell_idrac_power_unit
,
117 'check_function': check_dell_idrac_power_unit
,
118 'service_description': 'Power Supply %s',