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.
28 # .1.3.6.1.4.1.674.10892.1.600.10.1.2.1.1 1
29 # .1.3.6.1.4.1.674.10892.1.600.10.1.5.1.1 3
30 # .1.3.6.1.4.1.674.10892.1.600.10.1.6.1.1 0
31 # .1.3.6.1.4.1.674.10892.1.600.12.1.2.1.1 1
32 # .1.3.6.1.4.1.674.10892.1.600.12.1.2.1.2 2
33 # .1.3.6.1.4.1.674.10892.1.600.12.1.5.1.1 3
34 # .1.3.6.1.4.1.674.10892.1.600.12.1.5.1.2 3
35 # .1.3.6.1.4.1.674.10892.1.600.12.1.7.1.1 9
36 # .1.3.6.1.4.1.674.10892.1.600.12.1.7.1.2 9
37 # .1.3.6.1.4.1.674.10892.1.600.12.1.8.1.1 PS1 Status
38 # .1.3.6.1.4.1.674.10892.1.600.12.1.8.1.2 PS2 Status
41 def inventory_dell_om_power(info
):
42 for index
, _status
, _count
in info
[0]:
46 def check_dell_om_power(item
, params
, info
):
53 "6": (0, "not redundant"),
54 "7": (1, "redundancy offline"),
57 for index
, status
, _count
in info
[0]:
59 state
, state_readable
= translate_status
[status
]
60 yield state
, "Redundancy status: %s" % state_readable
63 check_info
['dell_om_power'] = {
64 'inventory_function': inventory_dell_om_power
,
65 'check_function': check_dell_om_power
,
66 'service_description': 'Power Supply Redundancy %s',
69 '.1.3.6.1.4.1.674.10892.1.600.10.1',
71 "2", # MIB-Dell-10892::powerUnitIndex
72 "5", # MIB-Dell-10892::powerUnitRedundancyStatus
73 "6", # MIB-Dell-10892::powerSupplyCountForRedundancy
76 '.1.3.6.1.4.1.674.10892.1.600.12.1',
78 "2", # MIB-Dell-10892::powerSupplyIndex
79 "5", # MIB-Dell-10892::powerSupplyStatus
80 "7", # MIB-Dell-10892::powerSupplyType
81 "8", # MIB-Dell-10892::powerSupplyLocationName
84 'snmp_scan_function': scan_dell_om
,
85 'includes': ["dell_om.include"],
89 def inventory_dell_om_power_unit(info
):
94 def check_dell_om_power_unit(item
, _no_params
, info
):
99 "4": (1, "NONCRITICAL"),
100 "5": (2, "CRITICAL"),
101 "6": (2, "NONRECOVERABLE"),
118 for index
, status
, psu_type
, location
in info
[1]:
120 state
, state_readable
= translate_status
[status
]
121 psu_type_readable
= translate_type
[psu_type
]
122 yield state
, "Status: %s, Type: %s, Name: %s" % \
123 ( state_readable
, psu_type_readable
, location
)
126 check_info
['dell_om_power.unit'] = {
127 'inventory_function': inventory_dell_om_power_unit
,
128 'check_function': check_dell_om_power_unit
,
129 'service_description': 'Power Supply %s',