Do not count Unconfigured(good) drives as an error

tags/zabbix-agent-addons-0.2.150-1
Daniel Berteaud 3 years ago
parent 1f7b7e86d8
commit f0e704ce95
  1. 7
      zabbix_scripts/check_raid_megaraid_sudo

@ -183,7 +183,7 @@ ADAPTER: for ( my $adp = 0; $adp < $adapters; $adp++ ) {
open (PDLIST, "$megacli -PdList -a$adp -NoLog |") open (PDLIST, "$megacli -PdList -a$adp -NoLog |")
|| die "error: Could not execute $megacli -PdList -a$adp -NoLog"; || die "error: Could not execute $megacli -PdList -a$adp -NoLog";
my ($slotnumber,$fwstate); my ($slotnumber,$fwstate,$fwinfo);
PDISKS: while (<PDLIST>) { PDISKS: while (<PDLIST>) {
if ( m/Slot Number:\s*(\d+)/ ) { if ( m/Slot Number:\s*(\d+)/ ) {
$slotnumber = $1; $slotnumber = $1;
@ -198,12 +198,15 @@ ADAPTER: for ( my $adp = 0; $adp < $adapters; $adp++ ) {
} }
} elsif ( m/Predictive Failure Count:\s*(\d+)/ ) { } elsif ( m/Predictive Failure Count:\s*(\d+)/ ) {
$prederrors += $1; $prederrors += $1;
} elsif ( m/Firmware state:\s*(\w+)/ ) { } elsif ( m/Firmware state:\s*(\w+)(.*)/ ) {
$fwstate = $1; $fwstate = $1;
$fwinfo = $2;
if ( $fwstate =~ m/Hotspare/ ) { if ( $fwstate =~ m/Hotspare/ ) {
$hotsparecount++; $hotsparecount++;
} elsif ( $fwstate =~ m/^Online/ ) { } elsif ( $fwstate =~ m/^Online/ ) {
# Do nothing # Do nothing
} elsif ( $fwstate =~ m/^Unconfigured/ && defined $fwinfo && $fwinfo =~ m/^\(good\)/) {
# Do nothing
} elsif ( $slotnumber != 255 ) { } elsif ( $slotnumber != 255 ) {
$pdbad++; $pdbad++;
$status = 'CRITICAL'; $status = 'CRITICAL';

Loading…
Cancel
Save