Cleanup config.nodes_of
[check_mk.git] / checks / emc_isilon_diskstatus
blob8c7347cef43c49024528ded1dac88988f73da1b5
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
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_emc_isilon_diskstatus(info):
29 for disk_id, _name, _disk_status, _serial in info:
30 yield disk_id, None
33 def check_emc_isilon_diskstatus(item, _no_params, info):
34 for disk_id, name, disk_status, serial in info:
35 if disk_id == item:
36 message = "Disk %s, serial number %s status is %s" % (name, serial, disk_status)
37 if disk_status in ["HEALTHY", "L3"]:
38 status = 0
39 else:
40 status = 2
41 return status, message
44 check_info["emc_isilon_diskstatus"] = {
45 "check_function": check_emc_isilon_diskstatus,
46 "inventory_function": inventory_emc_isilon_diskstatus,
47 "service_description": "Disk bay %s Status",
48 "snmp_info": (
49 ".1.3.6.1.4.1.12124.2.52.1",
51 1, # diskBay
52 4, # diskDeviceName
53 5, # diskStatus
54 7, # diskSerialNumber
55 ]),
56 "snmp_scan_function": lambda oid: "isilon" in oid(".1.3.6.1.2.1.1.1.0").lower(),