GUI CSS: Deployed view styles for layouts (CMK-1171)
[check_mk.git] / checks / tsm_storagepools
blobae6ae34e795d82b5150907e064e9f642cd4c19c8
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.
27 # <<<tsm_storagepool>>>
28 # tsmfarm2 Bkup LTOBACK 1399378.64
29 # tsmfarm2 Arch LTOARCHCOPY 157288.14
31 # <<<tsm_storagepool>>>
32 # default Bkup VP4200.GOLD 254776345.58^M
33 # default Bkup VP4200.TDP 204386407.76^M
34 # default Bkup VP860.CM 122661787.24^M
35 # default DPC.EXC.2013 ^M
36 # default DPC.EXC.CM ^M
37 # default DPC.EXCDAG ^M
38 # default DPC.GOLD.ALL ^M
39 # default DPC.GOLD.UNIX ^M
40 # default DPC.GOLD.VE
43 def parse_tsm_storagepools(info):
44 parsed = {}
45 for line in info:
46 if len(line) < 4:
47 continue
49 inst, stype, name, size = line[:4]
50 if inst == "default":
51 item = name
52 else:
53 item = inst + " / " + name
54 parsed.setdefault(item, {"type": stype, "size": size.replace(",", ".")})
56 return parsed
59 def inventory_tsm_storagepools(parsed):
60 for inst in parsed:
61 yield inst, None
64 def check_tsm_storagepools(item, _no_params, parsed):
65 if item not in parsed:
66 return 3, "no such storage pool"
68 data = parsed[item]
69 stype = data["type"]
70 size = int(float(data["size"]) * 1024**2)
71 return 0, "Used size: %s, Type: %s" % (get_bytes_human_readable(size), stype),\
72 [("used_space", size)]
75 check_info['tsm_storagepools'] = {
76 "parse_function": parse_tsm_storagepools,
77 "inventory_function": inventory_tsm_storagepools,
78 "check_function": check_tsm_storagepools,
79 "service_description": "TSM Storagepool %s",
80 "has_perfdata": True,