added cache_flash, power

This commit is contained in:
George Pochiscan 2020-09-03 15:23:08 +03:00
parent 6b0bf10039
commit d20dca6902
10 changed files with 236 additions and 36 deletions

View File

@ -0,0 +1,61 @@
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
# | Copyright Mathias Kettner 2020 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
#<<<hitachivsp_channel_board:sep(9)>>>
#location status type
#CHB-1A Normal 32G Ready 4Port FC
#CHB-1B Normal 32G Ready 4Port FC
#CHB-2A Normal 32G Ready 4Port FC
#CHB-2B Normal 32G Ready 4Port FC
def inventory_hitachivsp_cache_flash_memories(info):
for line in info:
if "location" not in line:
yield line[0], {}
def check_hitachivsp_cache_flash_memories(item, params, info):
for line in info:
if item == line[0]:
if line[1] == "Normal":
yield 0, "Cache memory status is Normal"
elif line[1] == "Warning":
yield 1, "Cache memory status is Warning"
elif line[1] == "Blocked":
yield 2, "Cache memory status is Blocked"
elif line[1] == "Blocked":
yield 2, "Cache memory status is Failed"
check_info['hitachivsp_cache_flash_memories'] = {
'inventory_function': inventory_hitachivsp_cache_flash_memories,
'check_function': check_hitachivsp_cache_flash_memories,
'service_description': 'Cache Flash Memory %s',
'has_perfdata': True
}

View File

@ -0,0 +1,56 @@
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
# | Copyright Mathias Kettner 2020 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
#<<<hitachivsp_cache_memories:sep(9)>>>
#location status cacheSize
#CTL1 CMG0 Normal 256
#CTL1 CMG1 Normal 256
#CTL2 CMG0 Normal 256
#CTL2 CMG1 Normal 256
def inventory_hitachivsp_cache_memories(info):
for line in info:
if "location" not in line:
yield line[0], {}
def check_hitachivsp_cache_memories(item, params, info):
for line in info:
if item == line[0]:
if line[1] == "Normal":
yield 0, "Cache memory status is Normal"
elif line[1] == "Warning":
yield 1, "Cache memory status is Warning"
check_info['hitachivsp_cache_memories'] = {
'inventory_function': inventory_hitachivsp_cache_memories,
'check_function': check_hitachivsp_cache_memories,
'service_description': 'Cache Memory %s',
'has_perfdata': True
}

View File

@ -0,0 +1,65 @@
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
# | Copyright Mathias Kettner 2020 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
<<<hitachivsp_channel_board:sep(9)>>>
location status type
CHB-1A Normal 32G Ready 4Port FC
CHB-1B Normal 32G Ready 4Port FC
CHB-2A Normal 32G Ready 4Port FC
CHB-2B Normal 32G Ready 4Port FC
def inventory_hitachivsp_channel_board(info):
for line in info:
if "location" not in line:
yield line[0], {}
def check_hitachivsp_channel_board(item, params, info):
for line in info:
if item == line[0]:
if line[1] == "Normal":
yield 0, "Channel board status is Normal, Channel board type: %s" %\
line[2]
elif line[1] == "Warning":
yield 1, "Channel board status is Warning, Channel board type: %s" %\
line[2]
elif line[1] == "Blocked":
yield 2, "Channel board status is Blocked, Channel board type: %s" %\
line[2]
elif line[1] == "Failed":
yield 2, "Channel board status is Failed, Channel board type: %s" %\
line[2]
check_info['hitachivsp_channel_board'] = {
'inventory_function': inventory_hitachivsp_channel_board,
'check_function': check_hitachivsp_channel_board,
'service_description': 'Channel Board %s',
'has_perfdata': True
}

View File

@ -52,3 +52,4 @@ check_info['hitachivsp_clprs'] = {
'service_description': 'CLPR %s', 'service_description': 'CLPR %s',
'has_perfdata': True 'has_perfdata': True
} }

View File

@ -26,9 +26,9 @@
#example output #example output
#<<<hitachivsp_ctls:sep(9)>>> #<<<hitachivsp_ctls:sep(9)>>>
#location status temperature temperatureStatus charge #location status temperature temperatureStatus charge
#CTL1 Normal 23 Normal 100 #CTL1 Normal 23 Normal 100
#CTL2 Normal 23 Normal 100 #CTL2 Normal 23 Normal 100
def inventory_hitachivsp_ctls(info): def inventory_hitachivsp_ctls(info):
@ -63,3 +63,4 @@ check_info['hitachivsp_ctls'] = {
'service_description': '%s', 'service_description': '%s',
'has_perfdata': True 'has_perfdata': True
} }

View File

@ -24,12 +24,23 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA. # Boston, MA 02110-1301 USA.
#.
# .--general-------------------------------------------------------------.
# | _ |
# | __ _ ___ _ __ ___ _ __ __ _| | |
# | / _` |/ _ \ '_ \ / _ \ '__/ _` | | |
# | | (_| | __/ | | | __/ | | (_| | | |
# | \__, |\___|_| |_|\___|_| \__,_|_| |
# | |___/ |
# +----------------------------------------------------------------------+
# | |
# '----------------------------------------------------------------------'
#example output #example output
#<<<hitachivsp_info:sep(9)>>> #<<<hitachivsp_info:sep(9)>>>
#666666 666666666666 88-04-03/00 VSP G700 #666666 666666666666 88-04-03/00 VSP G700
def inventory_hitachivsp_info(): def inventory_hitachivsp_info(info):
return [(None, None)] return [(None, None)]

View File

@ -23,15 +23,16 @@
# License along with GNU Make; see the file COPYING. If not, write # License along with GNU Make; see the file COPYING. If not, write
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA. # Boston, MA 02110-1301 USA.
#example output #example output
#<<<hitachivsp_ldevs:sep(9)>>> #<<<hitachivsp_ldevs:sep(9)>>>
#ldevId clprId byteFormatCapacity blockCapacity label status #ldevId clprId byteFormatCapacity blockCapacity label status
#0 0 500.00 G 1048576000 vg_test0 NML #0 0 500.00 G 1048576000 vg_test0 NML
#1 0 400.00 G 838860800 vg_test1 NML #1 0 400.00 G 838860800 vg_test1 NML
#2 0 10.00 T 21474836480 vmware_legacy_ssd0 NML #2 0 10.00 T 21474836480 vmware_legacy_ssd0 NML
#3 0 10.00 T 21474836480 vmware_legacy_ssd1 NML #3 0 10.00 T 21474836480 vmware_legacy_ssd1 NML
#4 0 5.00 T 10737418240 vmware_legacy_ssd2 NML #4 0 5.00 T 10737418240 vmware_legacy_ssd2 NML
#5 0 5.00 T 10737418240 vmware_legacy_ssd3 NML #5 0 5.00 T 10737418240 vmware_legacy_ssd3 NML
def inventory_hitachivsp_ldevs(info): def inventory_hitachivsp_ldevs(info):
@ -61,3 +62,4 @@ check_info['hitachivsp_ldevs'] = {
'service_description': 'LDEV %s', 'service_description': 'LDEV %s',
'has_perfdata': False 'has_perfdata': False
} }

View File

@ -26,13 +26,13 @@
#example output #example output
#<<<hitachivsp_parity_groups:sep(9)>>> #<<<hitachivsp_parity_groups:sep(9)>>>
#parityGroupId numOfLdevs usedCapacityRate clprId availableVolumeCapacity totalCapacity physicalCapacity #parityGroupId numOfLdevs usedCapacityRate clprId availableVolumeCapacity totalCapacity physicalCapacity
#1-1 26 44 0 87245 157286 39321 #1-1 26 44 0 87245 157286 39321
#1-2 51 93 0 10448 157286 39321 #1-2 51 93 0 10448 157286 39321
#1-3 25 42 0 90317 157286 39321 #1-3 25 42 0 90317 157286 39321
#1-4 52 95 0 7376 157286 39321 #1-4 52 95 0 7376 157286 39321
#1-5 54 99 0 1232 157286 39321 #1-5 54 99 0 1232 157286 39321
#1-6 25 42 0 90317 157286 39321 #1-6 25 42 0 90317 157286 39321
def inventory_hitachivsp_parity_groups(info): def inventory_hitachivsp_parity_groups(info):
@ -56,3 +56,4 @@ check_info['hitachivsp_parity_groups'] = {
'service_description': 'Parity Group %s', 'service_description': 'Parity Group %s',
'has_perfdata': True 'has_perfdata': True
} }

View File

@ -26,9 +26,9 @@
#example output #example output
#<<<hitachivsp_pools:sep(9)>>> #<<<hitachivsp_pools:sep(9)>>>
#poolID poolType poolName totalPhysicalCapacity totalPoolCapacity availableVolumeCapacity usedCapacityRate poolStatus #poolID poolType poolName totalPhysicalCapacity totalPoolCapacity availableVolumeCapacity usedCapacityRate poolStatus
#0 RT RAID6_HDT_01 397630296 397630296 208964826 47 POLN #0 RT RAID6_HDT_01 397630296 397630296 208964826 47 POLN
#1 HTI THIN_IMAGE_POOL 46453344 46453344 46453344 0 POLN #1 HTI THIN_IMAGE_POOL 46453344 46453344 46453344 0 POLN
def inventory_hitachivsp_pools(info): def inventory_hitachivsp_pools(info):
@ -42,13 +42,14 @@ def check_hitachivsp_pools(item, _no_params, info):
if item == line[0]: if item == line[0]:
perf_data = line[6] perf_data = line[6]
if line[7] == "POLE": if line[7] == "POLE":
yield 2, "Pool is suspended in failure status" yield 2, "Pool is suspended in failure status"
elif line[7] == "POLN": elif line[7] == "POLN":
yield 0, "Pool is Normal" yield 0, "Pool is Normal"
elif line[7] == "POLF": elif line[7] == "POLF":
yield 2, "Pool is Full" yield 2, "Pool is Full"
elif line[7] == "POLS": elif line[7] == "POLS":
yield 2, "Pool is Suspended" yield 2, "Pool is Suspended"
check_info['hitachivsp_pools'] = { check_info['hitachivsp_pools'] = {

View File

@ -35,8 +35,8 @@ def inventory_hitachivsp_powerConsumption(info):
def check_hitachivsp_powerConsumption(item, params, info): def check_hitachivsp_powerConsumption(item, params, info):
yield 0, "Power Consumption: %s " % int(line[1]), \ yield 0, "Power Consumption: %s " % int(info[0][1]), \
[("PowerConsumption", int(line[1]), None, None, 0)] [("PowerConsumption", int(info[0][1]), None, None, 0)]
check_info['hitachivsp_powerConsumption'] = { check_info['hitachivsp_powerConsumption'] = {
@ -45,3 +45,4 @@ check_info['hitachivsp_powerConsumption'] = {
'service_description': '%s', 'service_description': '%s',
'has_perfdata': True 'has_perfdata': True
} }