2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
10 # | Copyright Mathias Kettner 2013 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_eql_storage(info
):
33 def check_dell_eql_storage(item
, _no_params
, info
):
34 for name
, desc
, health_state
, raid_state
, total_storage
, \
35 repl_storage
, snap_storage
, used_storage
in info
:
47 if health_state
== "1":
49 elif health_state
in ["2", "0"]:
53 yield state
, "Health State: %s" % health_states
[health_state
]
60 "4": "Reconstructing",
62 "6": "CatastrophicLoss",
69 elif raid_state
in ["3", "4", "7", "8"]:
73 yield state
, "Raid State: %s" % raid_states
[raid_state
]
76 total_bytes
= int(total_storage
) * 1048576
77 used_bytes
= int(used_storage
) * 1048576
78 repl_bytes
= int(repl_storage
) * 1048576
79 snap_bytes
= int(snap_storage
) * 1048576
80 perfdata
= [("fs_used", used_bytes
), ("fs_size", total_bytes
)]
81 yield 0, "Used: %s/%s (Snapshots: %s, Replication: %s)" % \
82 (get_bytes_human_readable(used_bytes
), \
83 get_bytes_human_readable(total_bytes
),\
84 get_bytes_human_readable(snap_bytes
),\
85 get_bytes_human_readable(repl_bytes
)),\
90 check_info
["dell_eql_storage"] = {
91 "check_function" : check_dell_eql_storage
,
92 "inventory_function" : inventory_dell_eql_storage
,
93 "service_description" : "Storage %s",
94 "has_perfdata" : True,
95 "snmp_scan_function" : lambda oid
: "EQL-SUP" in oid(".1.3.6.1.2.1.1.1.0") or \
96 oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.12740.17"),
97 "snmp_info" : (".1.3.6.1.4.1.12740.2.1", [
98 "1.1.9.1", #eqlMemberName
99 "1.1.7.1", #eqlMemberDescription
100 "5.1.1.1", #eqlMemberHealthStatus
101 "13.1.1.1", #eqlMemberRaidStatus
102 "10.1.1.1", #eqlMemberTotalStorage
103 "10.1.4.1", #eqlMemberReplStorage
104 "10.1.3.1", #eqlMemberSnapStorage
105 "10.1.2.1", #eqlMemberUsedStorage