From 8a7c8534474e22c8d83b8c2ff69e08b8a4de4562 Mon Sep 17 00:00:00 2001 From: George Pochiscan Date: Thu, 3 Sep 2020 14:01:21 +0300 Subject: [PATCH] added parity_group check --- .../check_mk/checks/hitachivsp_parity_groups | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 hitachi-vsp/share/check_mk/checks/hitachivsp_parity_groups diff --git a/hitachi-vsp/share/check_mk/checks/hitachivsp_parity_groups b/hitachi-vsp/share/check_mk/checks/hitachivsp_parity_groups new file mode 100644 index 0000000..7a70763 --- /dev/null +++ b/hitachi-vsp/share/check_mk/checks/hitachivsp_parity_groups @@ -0,0 +1,58 @@ +#!/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 +#<<>> +#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): + for line in info: + if "parityGroupId" not in line: + yield line[0], {} + + +def check_hitachivsp_parity_groups(item, params, info): + for line in info: + if item == line[0]: + yield 0, "UsedCapacityRate: %s; AvailableVolumeCapacity(GB): %s; TotalCapacity(GB): %s" % \ + ( line[2], int(line[4]), int(line[5]) ), \ + [("UsedCapacityRate",line[2], None, None, 0), + ("AvailableVolumeCapacity", int(line[4]), None, None,0), + ("TotalCapacity", int(line[5]), None, None, 0)] + +check_info['hitachivsp_parity_groups'] = { + 'inventory_function': inventory_hitachivsp_parity_groups, + 'check_function': check_hitachivsp_parity_groups, + 'service_description': 'Parity Group %s', + 'has_perfdata': True +} \ No newline at end of file