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.
29 # .1.3.6.1.4.1.674.10892.1.600.10.1.2.1.1 1
30 # .1.3.6.1.4.1.674.10892.1.600.10.1.5.1.1 3
31 # .1.3.6.1.4.1.674.10892.1.600.10.1.6.1.1 0
32 # .1.3.6.1.4.1.674.10892.1.600.12.1.2.1.1 1
33 # .1.3.6.1.4.1.674.10892.1.600.12.1.2.1.2 2
34 # .1.3.6.1.4.1.674.10892.1.600.12.1.5.1.1 3
35 # .1.3.6.1.4.1.674.10892.1.600.12.1.5.1.2 3
36 # .1.3.6.1.4.1.674.10892.1.600.12.1.7.1.1 9
37 # .1.3.6.1.4.1.674.10892.1.600.12.1.7.1.2 9
38 # .1.3.6.1.4.1.674.10892.1.600.12.1.8.1.1 PS1 Status
39 # .1.3.6.1.4.1.674.10892.1.600.12.1.8.1.2 PS2 Status
42 def inventory_dell_om_power(info
):
43 for index
, _status
, _count
in info
[0]:
47 def check_dell_om_power(item
, params
, info
):
52 "4" : (1, "degraded"),
54 "6" : (0, "not redundant"),
55 "7" : (1, "redundancy offline"),
58 for index
, status
, _count
in info
[0]:
60 state
, state_readable
= translate_status
[status
]
61 yield state
, "Redundancy status: %s" % state_readable
64 check_info
['dell_om_power'] = {
65 'inventory_function' : inventory_dell_om_power
,
66 'check_function' : check_dell_om_power
,
67 'service_description' : 'Power Supply Redundancy %s',
68 'snmp_info' : [ ('.1.3.6.1.4.1.674.10892.1.600.10.1', [
69 "2", # MIB-Dell-10892::powerUnitIndex
70 "5", # MIB-Dell-10892::powerUnitRedundancyStatus
71 "6", # MIB-Dell-10892::powerSupplyCountForRedundancy
73 ('.1.3.6.1.4.1.674.10892.1.600.12.1', [
74 "2", # MIB-Dell-10892::powerSupplyIndex
75 "5", # MIB-Dell-10892::powerSupplyStatus
76 "7", # MIB-Dell-10892::powerSupplyType
77 "8", # MIB-Dell-10892::powerSupplyLocationName
80 'snmp_scan_function' : scan_dell_om
,
81 'includes' : [ "dell_om.include" ],
85 def inventory_dell_om_power_unit(info
):
87 yield ( line
[0], None )
90 def check_dell_om_power_unit(item
, _no_params
, info
):
95 "4" : (1, "NONCRITICAL"),
96 "5" : (2, "CRITICAL"),
97 "6" : (2, "NONRECOVERABLE"),
114 for index
, status
, psu_type
, location
in info
[1]:
116 state
, state_readable
= translate_status
[status
]
117 psu_type_readable
= translate_type
[psu_type
]
118 yield state
, "Status: %s, Type: %s, Name: %s" % \
119 ( state_readable
, psu_type_readable
, location
)
121 check_info
['dell_om_power.unit'] = {
122 'inventory_function' : inventory_dell_om_power_unit
,
123 'check_function' : check_dell_om_power_unit
,
124 'service_description' : 'Power Supply %s',