2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
10 # | Copyright Mathias Kettner 2017 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 #VOLUME f6a9425800000002:
31 # SIZE 8.0 TB (8192 GB)
32 # USER_DATA_READ_BWC 0 IOPS 0 Bytes per-second
33 # USER_DATA_WRITE_BWC 0 IOPS 0 Bytes per-second
35 #VOLUME f6a9425900000003:
38 # SIZE 5.0 TB (5120 GB)
39 # USER_DATA_READ_BWC 0 IOPS 0 Bytes per-second
40 # USER_DATA_WRITE_BWC 0 IOPS 0 Bytes per-second
44 def inventory_scaleio_volume(parsed
):
49 def check_scaleio_volume(item
, params
, parsed
):
56 data
= get_scaleio_data(item
, parsed
)
60 name
= data
["NAME"][0]
61 total
= int(data
["SIZE"][2].strip("("))
62 unit
= data
["SIZE"][3].strip(")")
64 # Assuming the API will never report
65 # a number bigger than 1048576
68 unit
= change_unit
[unit
]
69 yield 0, "Name: %s, Size: %.1f %s" % (name
, total
, unit
)
71 read_data
= data
["USER_DATA_READ_BWC"]
72 write_data
= data
["USER_DATA_WRITE_BWC"]
73 for io_type
in list(check_diskstat_dict(item
, params
, get_disks(item
, read_data
, write_data
))):
77 check_info
['scaleio_volume'] = {
78 'parse_function': lambda info
: parse_scaleio(info
, "VOLUME"),
79 'inventory_function': inventory_scaleio_volume
,
80 'check_function': check_scaleio_volume
,
81 'service_description': 'ScaleIO Volume %s',
82 'includes': ['scaleio.include', 'diskstat.include'],