mirror of
https://github.com/thomas-krenn/check_lsi_raid.git
synced 2026-02-27 22:28:41 +01:00
Improve line splitting for CV status
Fix regex for state checking
This commit is contained in:
@@ -770,18 +770,18 @@ sub getCVStatus {
|
||||
if(defined($currBlock)){
|
||||
$line =~ s/^\s+|\s+$//g;#trim line
|
||||
if($currBlock eq 'Cachevault_Info' && $line =~ /^State/){
|
||||
$line =~ /([a-zA-Z0-9]*)$/;
|
||||
if($1 ne "Optimal") {
|
||||
my @vals = split('\s{2,}',$line);
|
||||
if($vals[1] ne "Optimal") {
|
||||
$status = getExitState($status, STATE_WARNING);
|
||||
if($VERBOSITY == 0){$statusMessage .= "CV state not optimal, ";}
|
||||
if($VERBOSITY >= 1){$statusMessage .= "CV Cachevault_Info state $1, "; }
|
||||
if($VERBOSITY == 0){$statusMessage .= "CacheVault state not optimal, ";}
|
||||
if($VERBOSITY >= 1){$statusMessage .= "Cachevault Info state $1, "; }
|
||||
}
|
||||
}
|
||||
elsif($currBlock eq 'Firmware_Status' && $line =~ /^Replacement required/){
|
||||
$line =~ /([a-zA-Z0-9]*)$/;
|
||||
if($1 ne "No") {
|
||||
$status = getExitState($status, STATE_WARNING);
|
||||
$statusMessage .= "CV replacement required, ";
|
||||
$statusMessage .= "CacheVault replacement required, ";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user