From a38b7ab4b24d3334e0fbb7cc4c4b38bb1e03bb31 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 22 Jan 2020 16:23:26 +0100 Subject: [PATCH] Declar variable in the correct scope for hba mode detection --- zabbix_scripts/check_raid_megaraid_sudo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zabbix_scripts/check_raid_megaraid_sudo b/zabbix_scripts/check_raid_megaraid_sudo index fe0e996..db184e2 100755 --- a/zabbix_scripts/check_raid_megaraid_sudo +++ b/zabbix_scripts/check_raid_megaraid_sudo @@ -128,9 +128,9 @@ ADAPTER: for ( my $adp = 0; $adp < $adapters; $adp++ ) { open (CFGDSPLY, "$megacli -CfgDsply -a$adp -NoLog |") || die "error: Could not execute $megacli -CfgDsply -a$adp -NoLog"; + my $hba = 0; + my $failgrouplist = 0; while () { - my $hba = 0; - my $failgrouplist = 0; if ( m/Failed to get Disk Group list/ ) { $failgrouplist = 1; }