2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
10 # | Copyright Mathias Kettner 2016 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.
27 # For Hitachi Unified Storage (HUS) devices which support the USPMIB
28 # This devices has two units: Disk Controller (DKC) and Disk Unit (DKC)
30 # Example output from DKC:
31 #.1.3.6.1.4.1.116.5.11.4.1.1.6.1.1 470849
32 #.1.3.6.1.4.1.116.5.11.4.1.1.6.1.2 1
33 #.1.3.6.1.4.1.116.5.11.4.1.1.6.1.3 1
34 #.1.3.6.1.4.1.116.5.11.4.1.1.6.1.4 1
35 #.1.3.6.1.4.1.116.5.11.4.1.1.6.1.5 1
36 #.1.3.6.1.4.1.116.5.11.4.1.1.6.1.6 5
37 #.1.3.6.1.4.1.116.5.11.4.1.1.6.1.7 1
38 #.1.3.6.1.4.1.116.5.11.4.1.1.6.1.8 1
39 #.1.3.6.1.4.1.116.5.11.4.1.1.6.1.9 1
41 # Example output from DKU:
42 #.1.3.6.1.4.1.116.5.11.4.1.1.7.1.1 470849
43 #.1.3.6.1.4.1.116.5.11.4.1.1.7.1.2 1
44 #.1.3.6.1.4.1.116.5.11.4.1.1.7.1.3 4
45 #.1.3.6.1.4.1.116.5.11.4.1.1.7.1.4 3
46 #.1.3.6.1.4.1.116.5.11.4.1.1.7.1.5 1
49 def scan_hitachi_hus(oid
):
50 return "hm700" in oid(".1.3.6.1.2.1.1.1.0").lower() or \
51 "hm800" in oid(".1.3.6.1.2.1.1.1.0").lower()
54 def inventory_hitachi_hus(info
):
56 # set dkuRaidListIndexSerialNumber as item
60 def check_hitachi_hus(item
, _no_params
, info
):
61 # Maps for hitachi hus components
76 # We need to take care that the right map type is checked
96 # Check the state of the components and add the output to the state lists
101 for what
, device_state
in zip(component
, line
[1:]):
102 state
, state_readable
= hus_map_states
[device_state
]
104 ok_states
.append("%s: %s" % (what
, state_readable
))
106 warn_states
.append("%s: %s" % (what
, state_readable
))
108 crit_states
.append("%s: %s" % (what
, state_readable
))
110 unknown_states
.append("%s: %s" % (what
, state_readable
))
112 for state
, states
, text
in [
113 (0, ok_states
, "OK"),
114 (3, unknown_states
, "UNKNOWN"),
115 (1, warn_states
, "WARN"),
116 (2, crit_states
, "CRIT"),
119 yield state
, "%s: %s" % (text
, ", ".join(states
))