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_disks(info
):
29 return [("%s:%s:%s" % (x
[3], x
[4], x
[5]), None) for x
in info
]
32 def check_dell_om_disks(item
, _no_params
, info
):
33 #State definitions. Found in check_openmange from Trond H. Amundsen
35 1: 'VD member', # disk is a member of a virtual disk
36 2: 'DG member', # disk is a member of a disk group
37 3: 'Global HS', # disk is a global hot spare
38 4: 'Dedicated HS', # disk is a dedicated hot spare
39 5: 'no', # not a spare
69 22: 'Replacing', # FIXME: this one is not defined in the OMSA MIBs
74 34: 'Predictive failure',
82 for name
, dstate
, pid
, eid
, cid
, tid
, sizeMB
, btype
, sstate
, smart
, mt
in info
:
83 ditem
= "%s:%s:%s" % (eid
, cid
, tid
)
86 dstate
= saveint(dstate
)
87 btype
= saveint(btype
)
88 sstate
= saveint(sstate
)
89 smart
= saveint(smart
)
91 size
= saveint(sizeMB
) * 1024 * 1024
92 msg
= ["%s (%s, %s)" % (name
, pid
, get_bytes_human_readable(size
))]
96 if dstate
in [40, 35, 34, 26, 7, 4]:
99 elif dstate
not in [3, 1, 13]:
103 # handle hot spares as OK
104 if sstate
in [3, 4] and dstate
== 1:
108 msg
.append("state %s%s" % (pdisk_state
.get(dstate
, 'ukn (%s)' % dstate
), label
))
109 msg
.append("Bus Type: %s" % bus_type
.get(btype
, 'unk (%s)' % btype
))
112 msg
.append("Spare State: %s" % spare_state
.get(sstate
, 'ukn (%s)' % sstate
))
114 msg
.append("Media Type: %s" % media_type
.get(mt
, 'ukn (%s)' % mt
))
116 return state
, ", ".join(msg
)
117 return 3, "Device not found in SNMP tree"
120 check_info
["dell_om_disks"] = {
121 "check_function": check_dell_om_disks
,
122 "inventory_function": inventory_dell_om_disks
,
123 "service_description": "Physical Disk %s",
124 # There is no other way to find out that openmanage is present.
125 "snmp_scan_function": scan_dell_om
,
127 ".1.3.6.1.4.1.674.10893.1.20.130.4.1",
131 6, # arrayDiskProductID
132 9, # arrayDiskEnclosureID
133 10, # arrayDiskChannel
134 15, # arrayDiskTargetID
135 11, # arrayDiskLengthInMB
136 21, # arrayDiskBusType
137 22, # arrayDiskSpareState
138 #24, #arrayDiskComponentStatus
139 31, #arrayDiskSmartAlertIndication
140 35, # arrayDiskMediaType
142 "includes": ["dell_om.include"],