From 0135771c7a1555921c1ac2adeff922ffa22c627d Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 22 Jan 2020 16:18:49 +0100 Subject: [PATCH] Handle megaraid controlers in HBO/JBOD mode (skip RAID checks) --- zabbix_scripts/check_raid_megaraid_sudo | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/zabbix_scripts/check_raid_megaraid_sudo b/zabbix_scripts/check_raid_megaraid_sudo index 78dc73b..fe0e996 100755 --- a/zabbix_scripts/check_raid_megaraid_sudo +++ b/zabbix_scripts/check_raid_megaraid_sudo @@ -124,6 +124,25 @@ ADAPTER: for ( my $adp = 0; $adp < $adapters; $adp++ ) { } } close LDGETNUM; + + open (CFGDSPLY, "$megacli -CfgDsply -a$adp -NoLog |") + || die "error: Could not execute $megacli -CfgDsply -a$adp -NoLog"; + + while () { + my $hba = 0; + my $failgrouplist = 0; + if ( m/Failed to get Disk Group list/ ) { + $failgrouplist = 1; + } + if ( m/Product Name:.*(JBOD|HBA)/ ) { + $hba = 1; + } + } + close CFGDSPLY; + if ( $hba && $failgrouplist ) { + # Controler is in HBA mode, skip it + next ADAPTER; + } LDISK: for ( my $ld = 0; $ld < $ldnum; $ld++ ) { # Get info on this particular logical drive