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.
28 def inventory_dell_om_mem(info
):
29 return [(x
[0], None) for x
in info
]
32 # DellMemoryDeviceFailureModes ::= INTEGER {
33 # -- Note: These values are bit masks, so combination values are possible.
34 # -- If value is 0 (zero), memory device has no faults.
35 # eccSingleBitCorrectionWarningRate(1), -- ECC single bit correction warning rate exceeded
36 # eccSingleBitCorrectionFailureRate(2), -- ECC single bit correction failure rate exceeded
37 # eccMultiBitFault(4), -- ECC multibit fault encountered
38 # eccSingleBitCorrectionLoggingDisabled(8), -- ECC single bit correction logging disabled
39 # deviceDisabledBySpareActivation(16) -- device disabled because of spare activation
42 def check_dell_om_mem(item
, _no_params
, info
):
44 1: 'ECC single bit correction warning rate exceeded',
45 2: 'ECC single bit correction failure rate exceeded',
46 4: 'ECC multibit fault encountered',
47 8: 'ECC single bit correction logging disabled',
48 16: 'device disabled because of spare activation',
51 for location
, status
, size
, failuremode
in info
:
54 failuremode
= int(failuremode
)
60 if failuremode
& bitmask
!= 0:
62 yield 2, failure_modes
[bitmask
]
63 elif bitmask
in [1, 8, 16]:
64 yield 1, failure_modes
[bitmask
]
67 yield 0, "Size: %s" % get_bytes_human_readable(int(size
) * 1024)
70 check_info
["dell_om_mem"] = {
71 "check_function": check_dell_om_mem
,
72 "inventory_function": inventory_dell_om_mem
,
73 "service_description": "Memory Module %s",
74 # There is no other way to find out that openmanage is present.
75 "snmp_scan_function": scan_dell_om
,
77 ".1.3.6.1.4.1.674.10892.1.1100.50.1",
84 "includes": ["dell_om.include"],