diff --git a/hitachi-vsp/share/check_mk/checks/hitachivsp_cache_flash_memories b/hitachi-vsp/share/check_mk/checks/hitachivsp_cache_flash_memories new file mode 100644 index 0000000..e5324c0 --- /dev/null +++ b/hitachi-vsp/share/check_mk/checks/hitachivsp_cache_flash_memories @@ -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 +#<<>> +#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 +} + diff --git a/hitachi-vsp/share/check_mk/checks/hitachivsp_cache_memories b/hitachi-vsp/share/check_mk/checks/hitachivsp_cache_memories new file mode 100644 index 0000000..2d15f5f --- /dev/null +++ b/hitachi-vsp/share/check_mk/checks/hitachivsp_cache_memories @@ -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 +#<<>> +#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 +} + diff --git a/hitachi-vsp/share/check_mk/checks/hitachivsp_channel_board b/hitachi-vsp/share/check_mk/checks/hitachivsp_channel_board new file mode 100644 index 0000000..75c3b20 --- /dev/null +++ b/hitachi-vsp/share/check_mk/checks/hitachivsp_channel_board @@ -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 +<<>> +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 +} + diff --git a/hitachi-vsp/share/check_mk/checks/hitachivsp_clprs b/hitachi-vsp/share/check_mk/checks/hitachivsp_clprs index 10ec20f..822cfd3 100644 --- a/hitachi-vsp/share/check_mk/checks/hitachivsp_clprs +++ b/hitachi-vsp/share/check_mk/checks/hitachivsp_clprs @@ -52,3 +52,4 @@ check_info['hitachivsp_clprs'] = { 'service_description': 'CLPR %s', 'has_perfdata': True } + diff --git a/hitachi-vsp/share/check_mk/checks/hitachivsp_ctls b/hitachi-vsp/share/check_mk/checks/hitachivsp_ctls index c71a7d4..5f11725 100644 --- a/hitachi-vsp/share/check_mk/checks/hitachivsp_ctls +++ b/hitachi-vsp/share/check_mk/checks/hitachivsp_ctls @@ -26,9 +26,9 @@ #example output #<<>> -#location status temperature temperatureStatus charge -#CTL1 Normal 23 Normal 100 -#CTL2 Normal 23 Normal 100 +#location status temperature temperatureStatus charge +#CTL1 Normal 23 Normal 100 +#CTL2 Normal 23 Normal 100 def inventory_hitachivsp_ctls(info): @@ -55,7 +55,7 @@ def check_hitachivsp_ctls(item, params, info): yield 1, "Temperature Status is Warning: %s" % line[2] elif line[3] == "Failed": yield 2, "Temperature Status is Failed: %s" % line[2] - + check_info['hitachivsp_ctls'] = { 'inventory_function': inventory_hitachivsp_ctls, @@ -63,3 +63,4 @@ check_info['hitachivsp_ctls'] = { 'service_description': '%s', 'has_perfdata': True } + diff --git a/hitachi-vsp/share/check_mk/checks/hitachivsp_info b/hitachi-vsp/share/check_mk/checks/hitachivsp_info index 9ce3e97..8923395 100644 --- a/hitachi-vsp/share/check_mk/checks/hitachivsp_info +++ b/hitachi-vsp/share/check_mk/checks/hitachivsp_info @@ -24,12 +24,23 @@ # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA. +#. +# .--general-------------------------------------------------------------. +# | _ | +# | __ _ ___ _ __ ___ _ __ __ _| | | +# | / _` |/ _ \ '_ \ / _ \ '__/ _` | | | +# | | (_| | __/ | | | __/ | | (_| | | | +# | \__, |\___|_| |_|\___|_| \__,_|_| | +# | |___/ | +# +----------------------------------------------------------------------+ +# | | +# '----------------------------------------------------------------------' #example output #<<>> -#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)] @@ -42,4 +53,4 @@ check_info['hitachivsp_info'] = { 'inventory_function': inventory_hitachivsp_info, 'check_function': check_hitachivsp_info, 'service_description': 'Hitachi VSP Info', -} \ No newline at end of file +} diff --git a/hitachi-vsp/share/check_mk/checks/hitachivsp_ldevs b/hitachi-vsp/share/check_mk/checks/hitachivsp_ldevs index 8f00517..2c71d06 100644 --- a/hitachi-vsp/share/check_mk/checks/hitachivsp_ldevs +++ b/hitachi-vsp/share/check_mk/checks/hitachivsp_ldevs @@ -23,15 +23,16 @@ # 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 #<<>> -#ldevId clprId byteFormatCapacity blockCapacity label status -#0 0 500.00 G 1048576000 vg_test0 NML -#1 0 400.00 G 838860800 vg_test1 NML -#2 0 10.00 T 21474836480 vmware_legacy_ssd0 NML -#3 0 10.00 T 21474836480 vmware_legacy_ssd1 NML -#4 0 5.00 T 10737418240 vmware_legacy_ssd2 NML -#5 0 5.00 T 10737418240 vmware_legacy_ssd3 NML +#ldevId clprId byteFormatCapacity blockCapacity label status +#0 0 500.00 G 1048576000 vg_test0 NML +#1 0 400.00 G 838860800 vg_test1 NML +#2 0 10.00 T 21474836480 vmware_legacy_ssd0 NML +#3 0 10.00 T 21474836480 vmware_legacy_ssd1 NML +#4 0 5.00 T 10737418240 vmware_legacy_ssd2 NML +#5 0 5.00 T 10737418240 vmware_legacy_ssd3 NML def inventory_hitachivsp_ldevs(info): @@ -45,7 +46,7 @@ def check_hitachivsp_ldevs(item, params, info): if item == line[0]: if line[5] == "NML": yield 0, "Ldev is in normal status; byteFormatCapacity: %s ; blockCapacity: %s ; label %s ; \ - status %s" % (line[2], line[3], line[4], line[5]) + status %s" % (line[2], line[3], line[4], line[5]) elif line[5] == "BLK": yield 2, "Ldev is Blocked!!; byteFormatCapacity: %s ; blockCapacity: %s ; label %s ; \ status %s" % (line[2], line[3], line[4], line[5]) @@ -60,4 +61,5 @@ check_info['hitachivsp_ldevs'] = { 'check_function': check_hitachivsp_ldevs, 'service_description': 'LDEV %s', 'has_perfdata': False -} \ No newline at end of file +} + diff --git a/hitachi-vsp/share/check_mk/checks/hitachivsp_parity_groups b/hitachi-vsp/share/check_mk/checks/hitachivsp_parity_groups index 7a70763..3eefdd8 100644 --- a/hitachi-vsp/share/check_mk/checks/hitachivsp_parity_groups +++ b/hitachi-vsp/share/check_mk/checks/hitachivsp_parity_groups @@ -26,13 +26,13 @@ #example output #<<>> -#parityGroupId numOfLdevs usedCapacityRate clprId availableVolumeCapacity totalCapacity physicalCapacity -#1-1 26 44 0 87245 157286 39321 -#1-2 51 93 0 10448 157286 39321 -#1-3 25 42 0 90317 157286 39321 -#1-4 52 95 0 7376 157286 39321 -#1-5 54 99 0 1232 157286 39321 -#1-6 25 42 0 90317 157286 39321 +#parityGroupId numOfLdevs usedCapacityRate clprId availableVolumeCapacity totalCapacity physicalCapacity +#1-1 26 44 0 87245 157286 39321 +#1-2 51 93 0 10448 157286 39321 +#1-3 25 42 0 90317 157286 39321 +#1-4 52 95 0 7376 157286 39321 +#1-5 54 99 0 1232 157286 39321 +#1-6 25 42 0 90317 157286 39321 def inventory_hitachivsp_parity_groups(info): @@ -55,4 +55,5 @@ check_info['hitachivsp_parity_groups'] = { 'check_function': check_hitachivsp_parity_groups, 'service_description': 'Parity Group %s', 'has_perfdata': True -} \ No newline at end of file +} + diff --git a/hitachi-vsp/share/check_mk/checks/hitachivsp_pools b/hitachi-vsp/share/check_mk/checks/hitachivsp_pools index c0ef66c..b22ab07 100644 --- a/hitachi-vsp/share/check_mk/checks/hitachivsp_pools +++ b/hitachi-vsp/share/check_mk/checks/hitachivsp_pools @@ -26,9 +26,9 @@ #example output #<<>> -#poolID poolType poolName totalPhysicalCapacity totalPoolCapacity availableVolumeCapacity usedCapacityRate poolStatus -#0 RT RAID6_HDT_01 397630296 397630296 208964826 47 POLN -#1 HTI THIN_IMAGE_POOL 46453344 46453344 46453344 0 POLN +#poolID poolType poolName totalPhysicalCapacity totalPoolCapacity availableVolumeCapacity usedCapacityRate poolStatus +#0 RT RAID6_HDT_01 397630296 397630296 208964826 47 POLN +#1 HTI THIN_IMAGE_POOL 46453344 46453344 46453344 0 POLN def inventory_hitachivsp_pools(info): @@ -42,18 +42,19 @@ def check_hitachivsp_pools(item, _no_params, info): if item == line[0]: perf_data = line[6] if line[7] == "POLE": - yield 2, "Pool is suspended in failure status" + yield 2, "Pool is suspended in failure status" elif line[7] == "POLN": - yield 0, "Pool is Normal" + yield 0, "Pool is Normal" elif line[7] == "POLF": - yield 2, "Pool is Full" + yield 2, "Pool is Full" elif line[7] == "POLS": - yield 2, "Pool is Suspended" - + yield 2, "Pool is Suspended" + + check_info['hitachivsp_pools'] = { 'inventory_function': inventory_hitachivsp_pools, 'check_function': check_hitachivsp_pools, 'service_description': 'Pool %s', - 'has_perfdata': False -} \ No newline at end of file + 'has_perfdata': False +} diff --git a/hitachi-vsp/share/check_mk/checks/hitachivsp_powerConsumption b/hitachi-vsp/share/check_mk/checks/hitachivsp_powerConsumption index 840eb55..334dc60 100644 --- a/hitachi-vsp/share/check_mk/checks/hitachivsp_powerConsumption +++ b/hitachi-vsp/share/check_mk/checks/hitachivsp_powerConsumption @@ -35,8 +35,8 @@ def inventory_hitachivsp_powerConsumption(info): def check_hitachivsp_powerConsumption(item, params, info): - yield 0, "Power Consumption: %s " % int(line[1]), \ - [("PowerConsumption", int(line[1]), None, None, 0)] + yield 0, "Power Consumption: %s " % int(info[0][1]), \ + [("PowerConsumption", int(info[0][1]), None, None, 0)] check_info['hitachivsp_powerConsumption'] = { @@ -45,3 +45,4 @@ check_info['hitachivsp_powerConsumption'] = { 'service_description': '%s', 'has_perfdata': True } +