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.
29 # <<<storeonce_servicesets:sep(9)>>>
32 # ServiceSet Name Service Set 1
33 # ServiceSet Alias SET1
34 # Serial Number CZ25132LTD01
35 # Software Version 3.15.1-1636.1
36 # Product Class HPE StoreOnce 4700 Backup
37 # Capacity in bytes 75952808613643
38 # Free Space in bytes 53819324528395
39 # User Data Stored in bytes 305835970141743
40 # Size On Disk in bytes 19180587585836
41 # Deduplication Ratio 15.945078260668
42 # ServiceSet Health Level 1
43 # ServiceSet Health OK
44 # ServiceSet Status Running
45 # Replication Health Level 1
46 # Replication Health OK
47 # Replication Status Running
48 # Overall Health Level 1
50 # Overall Status Running
51 # Housekeeping Health Level 1
52 # Housekeeping Health OK
53 # Housekeeping Status Running
54 # Primary Node hpcz25132ltd
56 # Active Node hpcz25132ltd
58 # In newer agent outputs 'capacity' has changed:
59 # cloudCapacityBytes 0
61 # cloudReadWriteLicensedDiskBytes 0
64 # localCapacityBytes 136721392009216
65 # localDiskBytes 47759419043899
66 # localFreeBytes 85220347674624
67 # localUserBytes 265622218292968
68 # combinedCapacityBytes 136721392009216
69 # combinedDiskBytes 47759419043899
70 # combinedFreeBytes 85220347674624
71 # combinedUserBytes 265622218292968
75 return data
["ServiceSet ID"]
78 def inventory_storeonce_servicesets(parsed
):
79 for values
in parsed
.itervalues():
80 yield _get_item(values
), {}
83 def check_storeonce_servicesets(item
, params
, parsed
):
84 for values
in parsed
.itervalues():
85 if not item
== values
["ServiceSet ID"]:
88 if "ServiceSet Alias" in values
:
89 yield 0, "Alias: %s" % values
['ServiceSet Alias']
90 elif "ServiceSet Name" in values
:
91 yield 0, "Name: %s" % values
['ServiceSet Name']
93 yield 0, "Overall Status: %s, Overall Health: %s" % \
94 (values
['Overall Status'], values
['Overall Health'])
99 'Housekeeping Health',
101 state
= translate_storeonce_status(values
["%s Level" % component
])
102 state_readable
= "%s: %s" % (component
, values
[component
])
104 yield state
, state_readable
107 check_info
['storeonce_servicesets'] = {
108 'parse_function': parse_storeonce_servicesets
,
109 'inventory_function': inventory_storeonce_servicesets
,
110 'check_function': check_storeonce_servicesets
,
111 'service_description': 'ServiceSet %s Status',
112 'includes': ['storeonce.include'],
116 def check_storeonce_servicesets_capacity(item
, params
, parsed
):
117 for values
in parsed
.itervalues():
118 if _get_item(values
) == item
:
119 return check_storeonce_space(item
, params
, values
)
122 check_info
['storeonce_servicesets.capacity'] = {
123 'inventory_function': inventory_storeonce_servicesets
,
124 'check_function': check_storeonce_servicesets_capacity
,
125 'service_description': "ServiceSet %s Capacity",
126 'has_perfdata': True,
127 'group': "filesystem",
128 'includes': ["size_trend.include", "df.include", "storeonce.include"],