From d3cd364107f82d31a36d159f6c8008db972211e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georg=20Sch=C3=B6nberger?= Date: Fri, 10 Oct 2014 13:01:55 +0200 Subject: [PATCH] UGood is OK for PD, ensure to not overwrite PD or LD status --- check_lsi_raid | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/check_lsi_raid b/check_lsi_raid index 2d08776..c7f2225 100755 --- a/check_lsi_raid +++ b/check_lsi_raid @@ -441,7 +441,9 @@ sub getLDStatus{ $statusLevel_a[3]->{'LD_Status'} = $status; } else{ - $statusLevel_a[3]->{'LD_Status'} = 'OK'; + if(!exists($statusLevel_a[3]->{'LD_Status'})){ + $statusLevel_a[3]->{'LD_Status'} = 'OK'; + } } } @@ -488,7 +490,8 @@ sub getPhysicalDevices{ next; } if(defined($currBlock)){ - if($line =~ /^\d+\:\d+\s+\d+\s+\w+\s+\d+.*/){ + # If a drive is not in a group, a - is at the DG column + if($line =~ /^\d+\:\d+\s+\d+\s+\w+\s+[0-9-]+.*/){ @splittedLine = map { s/^\s*//; s/\s*$//; $_; } split(/\s+/,$line); # The current block is the c0/e252/s0 name $line_ref->{'pd'} = $currBlock; @@ -563,7 +566,7 @@ sub getPDStatus{ my $status; foreach my $PD (@foundPDs){ if(exists($PD->{'State'})){ - if($PD->{'State'} ne 'Onln'){ + if($PD->{'State'} ne 'Onln' && $PD->{'State'} ne 'UGood'){ $status = 'Critical'; push $statusLevel_a[2], $PD->{'pd'}.'_State'; $statusLevel_a[3]->{$PD->{'pd'}.'_State'} = $PD->{'State'}; @@ -648,7 +651,9 @@ sub getPDStatus{ $statusLevel_a[3]->{'PD_Status'} = $status; } else{ - $statusLevel_a[3]->{'PD_Status'} = 'OK'; + if(!exists($statusLevel_a[3]->{'PD_Status'})){ + $statusLevel_a[3]->{'PD_Status'} = 'OK'; + } } }