mirror of
https://github.com/thomas-krenn/check_lsi_raid.git
synced 2026-04-21 23:54:42 +02:00
Refactor code for logical device status
This commit is contained in:
+13
-11
@@ -369,25 +369,27 @@ sub getLogicalDeviceStatus {
|
||||
$flag = -1;
|
||||
my @values = split(' ',$line);
|
||||
if($values[2] ne "Optl") {
|
||||
if($values[4] eq "Yes") {
|
||||
$status = getExitState($status, STATE_WARNING);
|
||||
if ($VERBOSITY == 0) {$statusMessage .= "Virtual disk state not optimal, "; }
|
||||
if ($VERBOSITY >= 1) {$statusMessage .= "Virtual disk $output_dev state not optimal ($values[2]), "; }
|
||||
} else {
|
||||
# cachecade volumes cannot be checked for consistency
|
||||
if($values[4] ne "Yes" && $values[1] ne "Cac1"){
|
||||
$status = getExitState($status, STATE_CRITICAL);
|
||||
if($values[1] ne 'Cac1'){
|
||||
#check for consistency
|
||||
if($values[4] eq 'Yes'){
|
||||
if ($VERBOSITY == 0) {$statusMessage .= "Virtual disk state not optimal, "; }
|
||||
if ($VERBOSITY >= 1) {$statusMessage .= "Virtual disk $output_dev state not optimal ($values[2]), "; }
|
||||
}
|
||||
else{
|
||||
if ($VERBOSITY == 0) {$statusMessage .= "Virtual disk state not optimal - not consistant, "; }
|
||||
if ($VERBOSITY >= 1) {$statusMessage .= "Virtual disk $output_dev is not optimal - not consistant (state $values[2]), "; }
|
||||
}
|
||||
}
|
||||
else{
|
||||
if ($VERBOSITY == 0) {$statusMessage .= "Virtual cachecade disk state not optimal, "; }
|
||||
if ($VERBOSITY >= 1) {$statusMessage .= "Virtual cachecade disk $output_dev state not optimal ($values[2]), "; }
|
||||
}
|
||||
}
|
||||
else {
|
||||
# cachecade volumes cannot be checked for consistency
|
||||
if($values[4] ne "Yes" && $values[1] ne "Cac1"){
|
||||
$status = getExitState($status, STATE_WARNING);
|
||||
if ($VERBOSITY == 0) {$statusMessage .= "Virtual disk state optimal, but not consistent, "; }
|
||||
if ($VERBOSITY >= 1) {$statusMessage .= "Virtual disk $output_dev state optimal, but not consistent, "; }
|
||||
if ($VERBOSITY == 0) {$statusMessage .= "Virtual disk state optimal - but not consistent, "; }
|
||||
if ($VERBOSITY >= 1) {$statusMessage .= "Virtual disk $output_dev state optimal - but not consistent, "; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user