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 def parse_scaleio(info
, section
):
32 if line
[0].startswith(section
):
33 sys_id
= line
[1].replace(":", "")
35 elif sys_id
in parsed
:
36 parsed
[sys_id
][line
[0]] = line
[1:]
40 # This converts data into MB for our df.include
41 def convert_scaleio_space(unit
, value
):
43 return value
/ 1024 / 1024
51 return value
* 1024 * 1024
54 # Values can be in every unit. We need Bytes for
56 def convert_to_bytes(tp
, unit
):
62 return tp
* 1024 * 1024
64 return tp
* 1024 * 1024 * 1024
66 return tp
* 1024 * 1024 * 1024 * 1024
69 def get_disks(item
, read_data
, write_data
):
70 read_tp
= convert_to_bytes(int(read_data
[-3].strip("(")), \
71 read_data
[-2].strip(")"))
72 write_tp
= convert_to_bytes(int(write_data
[-3].strip("(")), \
73 write_data
[-2].strip(")"))
78 'read_ios': int(read_data
[0]),
79 'read_throughput': read_tp
,
80 'write_ios': int(write_data
[0]),
81 'write_throughput': write_tp
,
87 def get_scaleio_data(item
, parsed
):
88 return parsed
.get(item
)