added hp_storeonce clustered checks
This commit is contained in:
parent
3df43bbe83
commit
99e2590680
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,64 @@
|
||||
#!/usr/bin/python
|
||||
# -*- encoding: utf-8; py-indent-offset: 4 -*-
|
||||
# +------------------------------------------------------------------+
|
||||
# | ____ _ _ __ __ _ __ |
|
||||
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
|
||||
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
|
||||
# | | |___| | | | __/ (__| < | | | | . \ |
|
||||
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
|
||||
# | |
|
||||
# | Copyright Mathias Kettner 2017 mk@mathias-kettner.de |
|
||||
# +------------------------------------------------------------------+
|
||||
#
|
||||
# This file is part of Check_MK.
|
||||
# The official homepage is at http://mathias-kettner.de/check_mk.
|
||||
#
|
||||
# check_mk is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation in version 2. check_mk is distributed
|
||||
# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
|
||||
# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE. See the GNU General Public License for more de-
|
||||
# tails. You should have received a copy of the GNU General Public
|
||||
# License along with GNU Make; see the file COPYING. If not, write
|
||||
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
# Boston, MA 02110-1301 USA.
|
||||
|
||||
|
||||
def parse_storeonce_clusterinfo(info):
|
||||
parsed = {}
|
||||
for line in info:
|
||||
parsed[line[0]] = line[1]
|
||||
return parsed
|
||||
|
||||
def parse_storeonce_servicesets(info):
|
||||
parsed = {}
|
||||
for line in info:
|
||||
if line[0].startswith('['):
|
||||
item = line[0]
|
||||
parsed[item] = {}
|
||||
else:
|
||||
parsed[item][line[0]] = line[1]
|
||||
return parsed
|
||||
|
||||
def parse_storeonce_servicesets_team(info):
|
||||
parsed = {}
|
||||
for line in info:
|
||||
if line[0].startswith('['):
|
||||
item = line[0]
|
||||
parsed[item] = {}
|
||||
else:
|
||||
parsed[item][line[0]] = line[1]
|
||||
return parsed
|
||||
|
||||
|
||||
def translate_storeonce_status(status):
|
||||
translate_state = {
|
||||
'0' : 3, # Unknown
|
||||
'1' : 0, # OK
|
||||
'2' : 0, # Information
|
||||
'3' : 1, # Warning
|
||||
'4' : 2, # Critical
|
||||
}
|
||||
return translate_state[status]
|
||||
|
@ -0,0 +1,190 @@
|
||||
#!/usr/bin/python
|
||||
# -*- encoding: utf-8; py-indent-offset: 4 -*-
|
||||
# +------------------------------------------------------------------+
|
||||
# | ____ _ _ __ __ _ __ |
|
||||
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
|
||||
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
|
||||
# | | |___| | | | __/ (__| < | | | | . \ |
|
||||
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
|
||||
# | |
|
||||
# | Copyright Mathias Kettner 2017 mk@mathias-kettner.de |
|
||||
# +------------------------------------------------------------------+
|
||||
#
|
||||
# This file is part of Check_MK.
|
||||
# The official homepage is at http://mathias-kettner.de/check_mk.
|
||||
#
|
||||
# check_mk is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation in version 2. check_mk is distributed
|
||||
# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
|
||||
# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE. See the GNU General Public License for more de-
|
||||
# tails. You should have received a copy of the GNU General Public
|
||||
# License along with GNU Make; see the file COPYING. If not, write
|
||||
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
# Boston, MA 02110-1301 USA.
|
||||
|
||||
|
||||
# example output:
|
||||
#
|
||||
# <<<storeonce_clusterinfo:sep(9)>>>
|
||||
# Appliance Name HPCT15732RTD
|
||||
# Network Name 10.0.0.240
|
||||
# Serial Number CT15732RTD
|
||||
# Software Version 3.15.1-1636.1
|
||||
# Product Class HPE StoreOnce 4700 Backup
|
||||
# Total Capacity 75952.808613643
|
||||
# Free Space 53819.324528395
|
||||
# User Data Stored 305835.97014174
|
||||
# Size On Disk 19180.587585836
|
||||
# Total Capacity (bytes) 75952808613643
|
||||
# Free Space (bytes) 53819324528395
|
||||
# User Data Stored (bytes) 305835970141743
|
||||
# Size On Disk (bytes) 19180587585836
|
||||
# Dedupe Ratio 15.945078260667367
|
||||
# Cluster Health Level 1
|
||||
# Cluster Health OK
|
||||
# Cluster Status Running
|
||||
# Replication Health Level 1
|
||||
# Replication Health OK
|
||||
# Replication Status Running
|
||||
# Uptime Seconds 4305030
|
||||
# sysContact None
|
||||
# sysLocation None
|
||||
# isMixedCluster false
|
||||
|
||||
|
||||
#.
|
||||
# .--general-------------------------------------------------------------.
|
||||
# | _ |
|
||||
# | __ _ ___ _ __ ___ _ __ __ _| | |
|
||||
# | / _` |/ _ \ '_ \ / _ \ '__/ _` | | |
|
||||
# | | (_| | __/ | | | __/ | | (_| | | |
|
||||
# | \__, |\___|_| |_|\___|_| \__,_|_| |
|
||||
# | |___/ |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | |
|
||||
# '----------------------------------------------------------------------'
|
||||
|
||||
#def parse_storeonce_clusterinfo(info):
|
||||
# parsed = {}
|
||||
# for line in info:
|
||||
# parsed[line[0]] = line[1]
|
||||
# return parsed
|
||||
|
||||
|
||||
def inventory_storeonce_clusterinfo(parsed):
|
||||
if "Product Class" in parsed:
|
||||
return [ (parsed['Product Class'], None) ]
|
||||
|
||||
|
||||
def check_storeonce_clusterinfo(item, _no_params, parsed):
|
||||
return 0, "Name: %s, Serial Number: %s, Version: %s" % \
|
||||
(parsed['Appliance Name'],
|
||||
parsed['Serial Number'],
|
||||
parsed['Software Version'])
|
||||
|
||||
|
||||
check_info['storeonce_clusterinfo'] = {
|
||||
'parse_function' : parse_storeonce_clusterinfo,
|
||||
'inventory_function' : inventory_storeonce_clusterinfo,
|
||||
'check_function' : check_storeonce_clusterinfo,
|
||||
'service_description' : '%s',
|
||||
'includes' : [ 'storeonce.include' ],
|
||||
}
|
||||
|
||||
#.
|
||||
# .--cluster-------------------------------------------------------------.
|
||||
# | _ _ |
|
||||
# | ___| |_ _ ___| |_ ___ _ __ |
|
||||
# | / __| | | | / __| __/ _ \ '__| |
|
||||
# | | (__| | |_| \__ \ || __/ | |
|
||||
# | \___|_|\__,_|___/\__\___|_| |
|
||||
# | |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | |
|
||||
# '----------------------------------------------------------------------'
|
||||
|
||||
def inventory_storeonce_clusterinfo_cluster(parsed):
|
||||
if "Cluster Health" in parsed:
|
||||
return [ (None, {}) ]
|
||||
|
||||
def check_storeonce_clusterinfo_cluster(item, params, parsed):
|
||||
yield 0, "Cluster Status: %s, Replication Status: %s" % \
|
||||
(parsed['Cluster Status'], parsed['Replication Status'])
|
||||
|
||||
# Check state of components
|
||||
for component in ['Cluster Health', 'Replication Health']:
|
||||
state = translate_storeonce_status(parsed['%s Level' % component])
|
||||
state_readable = "%s: %s" % (component, parsed[component])
|
||||
if state > 0:
|
||||
yield state, state_readable
|
||||
|
||||
check_info['storeonce_clusterinfo.cluster'] = {
|
||||
'inventory_function' : inventory_storeonce_clusterinfo_cluster,
|
||||
'check_function' : check_storeonce_clusterinfo_cluster,
|
||||
'service_description' : 'Appliance Status',
|
||||
}
|
||||
|
||||
#.
|
||||
# .--cluster space-------------------------------------------------------.
|
||||
# | _ _ |
|
||||
# | ___| |_ _ ___| |_ ___ _ __ ___ _ __ __ _ ___ ___ |
|
||||
# | / __| | | | / __| __/ _ \ '__| / __| '_ \ / _` |/ __/ _ \ |
|
||||
# | | (__| | |_| \__ \ || __/ | \__ \ |_) | (_| | (_| __/ |
|
||||
# | \___|_|\__,_|___/\__\___|_| |___/ .__/ \__,_|\___\___| |
|
||||
# | |_| |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | |
|
||||
# '----------------------------------------------------------------------'
|
||||
|
||||
def inventory_storeonce_clusterinfo_space(parsed):
|
||||
return [ ('Total Capacity', {}) ]
|
||||
|
||||
def check_storeonce_clusterinfo_space(item, params, parsed):
|
||||
total_mb = float(parsed['Total Capacity (bytes)'])/1024/1024
|
||||
free_mb = float(parsed['Free Space (bytes)'])/1024/1024
|
||||
|
||||
yield df_check_filesystem_list(item, params, [ (item, total_mb, free_mb, 0) ])
|
||||
|
||||
dedup = float(parsed['Dedupe Ratio'])
|
||||
|
||||
yield 0, "Dedup: %.2f" % dedup
|
||||
|
||||
check_info['storeonce_clusterinfo.space'] = {
|
||||
'inventory_function' : inventory_storeonce_clusterinfo_space,
|
||||
'check_function' : check_storeonce_clusterinfo_space,
|
||||
'service_description' : "%s",
|
||||
'has_perfdata' : True,
|
||||
'includes' : [ "size_trend.include", "df.include"],
|
||||
'group' : "filesystem",
|
||||
'default_levels_variable' : "filesystem_Default_levels",
|
||||
}
|
||||
|
||||
#.
|
||||
# .--uptime--------------------------------------------------------------.
|
||||
# | _ _ |
|
||||
# | _ _ _ __ | |_(_)_ __ ___ ___ |
|
||||
# | | | | | '_ \| __| | '_ ` _ \ / _ \ |
|
||||
# | | |_| | |_) | |_| | | | | | | __/ |
|
||||
# | \__,_| .__/ \__|_|_| |_| |_|\___| |
|
||||
# | |_| |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | |
|
||||
# '----------------------------------------------------------------------'
|
||||
|
||||
def inventory_storeonce_clusterinfo_uptime(parsed):
|
||||
return [ (None, {}) ]
|
||||
|
||||
def check_storeonce_clusterinfo_uptime(item, params, parsed):
|
||||
uptime = float(parsed['Uptime Seconds'])
|
||||
return check_uptime_seconds(params, uptime)
|
||||
|
||||
check_info['storeonce_clusterinfo.uptime'] = {
|
||||
'inventory_function' : inventory_storeonce_clusterinfo_uptime,
|
||||
'check_function' : check_storeonce_clusterinfo_uptime,
|
||||
'service_description' : "Uptime",
|
||||
'has_perfdata' : True,
|
||||
'includes' : [ "uptime.include"],
|
||||
'group' : "uptime",
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
#!/usr/bin/python
|
||||
# -*- encoding: utf-8; py-indent-offset: 4 -*-
|
||||
# +------------------------------------------------------------------+
|
||||
# | ____ _ _ __ __ _ __ |
|
||||
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
|
||||
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
|
||||
# | | |___| | | | __/ (__| < | | | | . \ |
|
||||
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
|
||||
# | |
|
||||
# | Copyright Mathias Kettner 2017 mk@mathias-kettner.de |
|
||||
# +------------------------------------------------------------------+
|
||||
#
|
||||
# This file is part of Check_MK.
|
||||
# The official homepage is at http://mathias-kettner.de/check_mk.
|
||||
#
|
||||
# check_mk is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation in version 2. check_mk is distributed
|
||||
# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
|
||||
# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE. See the GNU General Public License for more de-
|
||||
# tails. You should have received a copy of the GNU General Public
|
||||
# License along with GNU Make; see the file COPYING. If not, write
|
||||
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
# Boston, MA 02110-1301 USA.
|
||||
|
||||
|
||||
# example output
|
||||
#
|
||||
# <<<storeonce_servicesets:sep(9)>>>
|
||||
# [1]
|
||||
# ServiceSet ID 1
|
||||
# ServiceSet Name Service Set 1
|
||||
# ServiceSet Alias SET1
|
||||
# Serial Number CZ25132LTD01
|
||||
# Software Version 3.15.1-1636.1
|
||||
# Product Class HPE StoreOnce 4700 Backup
|
||||
# Capacity in bytes 75952808613643
|
||||
# Free Space in bytes 53819324528395
|
||||
# User Data Stored in bytes 305835970141743
|
||||
# Size On Disk in bytes 19180587585836
|
||||
# Deduplication Ratio 15.945078260668
|
||||
# ServiceSet Health Level 1
|
||||
# ServiceSet Health OK
|
||||
# ServiceSet Status Running
|
||||
# Replication Health Level 1
|
||||
# Replication Health OK
|
||||
# Replication Status Running
|
||||
# Overall Health Level 1
|
||||
# Overall Health OK
|
||||
# Overall Status Running
|
||||
# Housekeeping Health Level 1
|
||||
# Housekeeping Health OK
|
||||
# Housekeeping Status Running
|
||||
# Primary Node hpcz25132ltd
|
||||
# Secondary Node None
|
||||
# Active Node hpcz25132ltd
|
||||
|
||||
|
||||
def inventory_storeonce_servicesets(parsed):
|
||||
for key, values in parsed.iteritems():
|
||||
yield ( values["ServiceSet ID"], {} )
|
||||
|
||||
def check_storeonce_servicesets(item, params, parsed):
|
||||
for key, values in parsed.iteritems():
|
||||
if not item == values["ServiceSet ID"]:
|
||||
continue
|
||||
|
||||
if "ServiceSet Alias" in values:
|
||||
yield 0, "Alias: %s" % values['ServiceSet Alias']
|
||||
elif "ServiceSet Name" in values:
|
||||
yield 0, "Name: %s" % values['ServiceSet Name']
|
||||
|
||||
yield 0, "Overall Status: %s, Overall Health: %s" % \
|
||||
(values['Overall Status'], values['Overall Health'])
|
||||
|
||||
for component in ['ServiceSet Health',
|
||||
'Replication Health',
|
||||
'Housekeeping Health']:
|
||||
state = translate_storeonce_status(values["%s Level" % component])
|
||||
state_readable = "%s: %s" % (component, values[component])
|
||||
if state > 0:
|
||||
yield state, state_readable
|
||||
|
||||
|
||||
check_info['storeonce_servicesets'] = {
|
||||
'parse_function' : parse_storeonce_servicesets,
|
||||
'inventory_function' : inventory_storeonce_servicesets,
|
||||
'check_function' : check_storeonce_servicesets,
|
||||
'service_description' : 'ServiceSet %s Status',
|
||||
'includes' : [ 'storeonce.include' ],
|
||||
}
|
||||
|
||||
|
||||
def inventory_storeonce_servicesets_capacity(parsed):
|
||||
for key, values in parsed.iteritems():
|
||||
yield ( values["ServiceSet ID"], {} )
|
||||
|
||||
def check_storeonce_servicesets_capacity(item, params, parsed):
|
||||
for key, values in parsed.iteritems():
|
||||
if not item == values["ServiceSet ID"]:
|
||||
continue
|
||||
total_mb = float(values['Capacity in bytes'])/1024/1024
|
||||
free_mb = float(values['Free Space in bytes'])/1024/1024
|
||||
yield df_check_filesystem_list(item, params, [ (item, total_mb, free_mb, 0) ])
|
||||
|
||||
dedup = float(values['Deduplication Ratio'])
|
||||
|
||||
yield 0, "Dedup ratio: %.2f" % dedup
|
||||
|
||||
|
||||
check_info['storeonce_servicesets.capacity'] = {
|
||||
'parse_function' : parse_storeonce_servicesets,
|
||||
'inventory_function' : inventory_storeonce_servicesets_capacity,
|
||||
'check_function' : check_storeonce_servicesets_capacity,
|
||||
'service_description' : "ServiceSet %s Capacity",
|
||||
'has_perfdata' : True,
|
||||
'group' : "filesystem",
|
||||
'includes' : [ "size_trend.include", "df.include" ],
|
||||
}
|
115
check_mk-storeonce/local/share/check_mk/checks/storeonce_stores
Normal file
115
check_mk-storeonce/local/share/check_mk/checks/storeonce_stores
Normal file
@ -0,0 +1,115 @@
|
||||
#!/usr/bin/python
|
||||
# -*- encoding: utf-8; py-indent-offset: 4 -*-
|
||||
# +------------------------------------------------------------------+
|
||||
# | ____ _ _ __ __ _ __ |
|
||||
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
|
||||
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
|
||||
# | | |___| | | | __/ (__| < | | | | . \ |
|
||||
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
|
||||
# | |
|
||||
# | Copyright Mathias Kettner 2017 mk@mathias-kettner.de |
|
||||
# +------------------------------------------------------------------+
|
||||
#
|
||||
# This file is part of Check_MK.
|
||||
# The official homepage is at http://mathias-kettner.de/check_mk.
|
||||
#
|
||||
# check_mk is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation in version 2. check_mk is distributed
|
||||
# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
|
||||
# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE. See the GNU General Public License for more de-
|
||||
# tails. You should have received a copy of the GNU General Public
|
||||
# License along with GNU Make; see the file COPYING. If not, write
|
||||
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
# Boston, MA 02110-1301 USA.
|
||||
|
||||
|
||||
|
||||
# <<<storeonce_stores:sep(9)>>>
|
||||
# [1/0]
|
||||
# Store ID 0
|
||||
# Name VM_WinSrv_Store
|
||||
# Description Catalyst Store for Windows based Server
|
||||
# ServiceSet ID 1
|
||||
# Creation Time UTC 1434446799
|
||||
# Health Level 1
|
||||
# Health OK
|
||||
# Status Online
|
||||
# Version 2
|
||||
# Number Of Catalyst Items 274
|
||||
# User Data Stored 1467.568399314
|
||||
# Size On Disk 604.827284898
|
||||
# Dedupe Ratio 2.4
|
||||
# Dedupe Ratio 2.4
|
||||
# Creation On 2015-06-16T09:26:39Z
|
||||
# Last Modified 2015-06-16T09:26:39Z
|
||||
# primaryTransferPolicy 0
|
||||
# primaryTransferPolicyString High Bandwidth
|
||||
# secondaryTransferPolicy 1
|
||||
# secondaryTransferPolicyString Low Bandwidth
|
||||
# userDataSizeLimitBytes 0
|
||||
# dedupedDataSizeOnDiskLimitBytes 0
|
||||
# dataJobRetentionDays 90
|
||||
# inboundCopyJobRetentionDays 90
|
||||
# outboundCopyJobRetentionDays 90
|
||||
# supportStorageModeVariableBlockDedupe true
|
||||
# supportStorageModeFixedBlockDedupe true
|
||||
# supportStorageModeNoDedupe true
|
||||
# supportWriteSparse false
|
||||
# supportWriteInPlace false
|
||||
# supportRawReadWrite true
|
||||
# supportMultipleObjectOpeners true
|
||||
# supportMultipleObjectWrites false
|
||||
# supportCloneExtent true
|
||||
# userBytes 1467568399314
|
||||
# diskBytes 604827284898
|
||||
# numItems 274
|
||||
# numDataJobs 2536
|
||||
# numOriginCopyJobs 0
|
||||
# numDestinationCopyJobs 0
|
||||
# Is online true
|
||||
# is store encrypted false
|
||||
# secure erase mode 0
|
||||
# secure erase mode description Secure_Erase_NoPassCount
|
||||
# isTeamed false
|
||||
# teamUUID 0000014DFBB121BB2954110834BAD600
|
||||
# numTeamMembers 0
|
||||
|
||||
|
||||
def inventory_storeonce_stores(parsed):
|
||||
for key, values in parsed.iteritems():
|
||||
yield ("ServiceSet %s Store %s" % \
|
||||
(values["ServiceSet ID"], values["Name"]), \
|
||||
{})
|
||||
|
||||
|
||||
def check_storeonce_stores(item, params, parsed):
|
||||
for key, values in parsed.iteritems():
|
||||
item_name = "ServiceSet %s Store %s" % \
|
||||
(values["ServiceSet ID"], values["Name"])
|
||||
if not item == item_name:
|
||||
continue
|
||||
|
||||
state = translate_storeonce_status(values["Health Level"])
|
||||
size = float(values["diskBytes"])
|
||||
yield state, "Status: %s, Size: %s" % \
|
||||
(values["Status"], get_bytes_human_readable(size)), \
|
||||
[ ("data_size", size) ]
|
||||
|
||||
if "Dedupe Ratio" in values:
|
||||
dedup = float(values["Dedupe Ratio"])
|
||||
yield 0, "Dedup ratio: %.2f" % dedup, \
|
||||
[ ( "dedup_rate", dedup) ]
|
||||
if not values["Description"] == "":
|
||||
yield 0, "Description: %s" % values["Description"]
|
||||
|
||||
|
||||
check_info['storeonce_stores'] = {
|
||||
'parse_function' : parse_storeonce_servicesets,
|
||||
'inventory_function' : inventory_storeonce_stores,
|
||||
'check_function' : check_storeonce_stores,
|
||||
'service_description' : '%s',
|
||||
'has_perfdata' : True,
|
||||
'includes' : [ "storeonce.include" ],
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
#!/usr/bin/python
|
||||
# -*- encoding: utf-8; py-indent-offset: 4 -*-
|
||||
# +------------------------------------------------------------------+
|
||||
# | ____ _ _ __ __ _ __ |
|
||||
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
|
||||
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
|
||||
# | | |___| | | | __/ (__| < | | | | . \ |
|
||||
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
|
||||
# | |
|
||||
# | Copyright Mathias Kettner 2017 mk@mathias-kettner.de |
|
||||
# +------------------------------------------------------------------+
|
||||
#
|
||||
# This file is part of Check_MK.
|
||||
# The official homepage is at http://mathias-kettner.de/check_mk.
|
||||
#
|
||||
# check_mk is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation in version 2. check_mk is distributed
|
||||
# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
|
||||
# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE. See the GNU General Public License for more de-
|
||||
# tails. You should have received a copy of the GNU General Public
|
||||
# License along with GNU Make; see the file COPYING. If not, write
|
||||
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
# Boston, MA 02110-1301 USA.
|
||||
|
||||
|
||||
|
||||
def inventory_storeonce_stores_team(parsed):
|
||||
for key, values in parsed.iteritems():
|
||||
yield ("Store %s Store %s" % \
|
||||
(values["Store ID"], values["Name"]), \
|
||||
{})
|
||||
|
||||
|
||||
def check_storeonce_stores_team(item, params, parsed):
|
||||
for key, values in parsed.iteritems():
|
||||
item_name = "Store %s Store %s" % \
|
||||
(values["Store ID"], values["Name"])
|
||||
if not item == item_name:
|
||||
continue
|
||||
|
||||
state = translate_storeonce_status(values["Health Level"])
|
||||
size = float(values["Size On Disk"])
|
||||
yield state, "Status: %s, Size: %s" % \
|
||||
(values["Status"], get_bytes_human_readable(size)), \
|
||||
[ ("data_size", size) ]
|
||||
|
||||
if "Dedupe Ratio" in values:
|
||||
dedup = float(values["Dedupe Ratio"])
|
||||
yield 0, "Dedup ratio: %.2f" % dedup, \
|
||||
[ ( "dedup_rate", dedup) ]
|
||||
if not values["Description"] == "":
|
||||
yield 0, "Description: %s" % values["Description"]
|
||||
|
||||
|
||||
check_info['storeonce_stores_team'] = {
|
||||
'parse_function' : parse_storeonce_servicesets_team,
|
||||
'inventory_function' : inventory_storeonce_stores_team,
|
||||
'check_function' : check_storeonce_stores_team,
|
||||
'service_description' : '%s',
|
||||
'has_perfdata' : True,
|
||||
'includes' : [ "storeonce.include" ],
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
#!/usr/bin/python
|
||||
# -*- encoding: utf-8; py-indent-offset: 4 -*-
|
||||
# +------------------------------------------------------------------+
|
||||
# | ____ _ _ __ __ _ __ |
|
||||
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
|
||||
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
|
||||
# | | |___| | | | __/ (__| < | | | | . \ |
|
||||
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
|
||||
# | |
|
||||
# | Copyright Mathias Kettner 2017 mk@mathias-kettner.de |
|
||||
# +------------------------------------------------------------------+
|
||||
#
|
||||
# This file is part of Check_MK.
|
||||
# The official homepage is at http://mathias-kettner.de/check_mk.
|
||||
#
|
||||
# check_mk is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation in version 2. check_mk is distributed
|
||||
# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
|
||||
# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE. See the GNU General Public License for more de-
|
||||
# tails. You should have received a copy of the GNU General Public
|
||||
# License along with GNU Make; see the file COPYING. If not, write
|
||||
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
# Boston, MA 02110-1301 USA.
|
||||
|
||||
|
||||
|
||||
# <<<storeonce_stores:sep(9)>>>
|
||||
# [1/0]
|
||||
# Store ID 0
|
||||
# Name VM_WinSrv_Store
|
||||
# Description Catalyst Store for Windows based Server
|
||||
# ServiceSet ID 1
|
||||
# Creation Time UTC 1434446799
|
||||
# Health Level 1
|
||||
# Health OK
|
||||
# Status Online
|
||||
# Version 2
|
||||
# Number Of Catalyst Items 274
|
||||
# User Data Stored 1467.568399314
|
||||
# Size On Disk 604.827284898
|
||||
# Dedupe Ratio 2.4
|
||||
# Dedupe Ratio 2.4
|
||||
# Creation On 2015-06-16T09:26:39Z
|
||||
# Last Modified 2015-06-16T09:26:39Z
|
||||
# primaryTransferPolicy 0
|
||||
# primaryTransferPolicyString High Bandwidth
|
||||
# secondaryTransferPolicy 1
|
||||
# secondaryTransferPolicyString Low Bandwidth
|
||||
# userDataSizeLimitBytes 0
|
||||
# dedupedDataSizeOnDiskLimitBytes 0
|
||||
# dataJobRetentionDays 90
|
||||
# inboundCopyJobRetentionDays 90
|
||||
# outboundCopyJobRetentionDays 90
|
||||
# supportStorageModeVariableBlockDedupe true
|
||||
# supportStorageModeFixedBlockDedupe true
|
||||
# supportStorageModeNoDedupe true
|
||||
# supportWriteSparse false
|
||||
# supportWriteInPlace false
|
||||
# supportRawReadWrite true
|
||||
# supportMultipleObjectOpeners true
|
||||
# supportMultipleObjectWrites false
|
||||
# supportCloneExtent true
|
||||
# userBytes 1467568399314
|
||||
# diskBytes 604827284898
|
||||
# numItems 274
|
||||
# numDataJobs 2536
|
||||
# numOriginCopyJobs 0
|
||||
# numDestinationCopyJobs 0
|
||||
# Is online true
|
||||
# is store encrypted false
|
||||
# secure erase mode 0
|
||||
# secure erase mode description Secure_Erase_NoPassCount
|
||||
# isTeamed false
|
||||
# teamUUID 0000014DFBB121BB2954110834BAD600
|
||||
# numTeamMembers 0
|
||||
|
||||
|
||||
def inventory_storeonce_stores(parsed):
|
||||
for key, values in parsed.iteritems():
|
||||
yield ("ServiceSet %s Store %s" % \
|
||||
(values["ServiceSet ID"], values["Name"]), \
|
||||
{})
|
||||
|
||||
def check_storeonce_stores(item, params, parsed):
|
||||
for key, values in parsed.iteritems():
|
||||
item_name = "ServiceSet %s Store %s" % \
|
||||
(values["ServiceSet ID"], values["Name"])
|
||||
if not item == item_name:
|
||||
continue
|
||||
|
||||
state = translate_storeonce_status(values["Health Level"])
|
||||
size = float(values["diskBytes"])
|
||||
yield state, "Status: %s, Size: %s" % \
|
||||
(values["Status"], get_bytes_human_readable(size)), \
|
||||
[ ("data_size", size) ]
|
||||
|
||||
if "Dedupe Ratio" in values:
|
||||
dedup = float(values["Dedupe Ratio"])
|
||||
yield 0, "Dedup ratio: %.2f" % dedup, \
|
||||
[ ( "dedup_rate", dedup) ]
|
||||
if not values["Description"] == "":
|
||||
yield 0, "Description: %s" % values["Description"]
|
||||
|
||||
|
||||
check_info['storeonce_stores'] = {
|
||||
'parse_function' : parse_storeonce_servicesets,
|
||||
'inventory_function' : inventory_storeonce_stores,
|
||||
'check_function' : check_storeonce_stores,
|
||||
'service_description' : '%s',
|
||||
'has_perfdata' : True,
|
||||
'includes' : [ "storeonce.include" ],
|
||||
}
|
Loading…
Reference in New Issue
Block a user