mirror of
https://github.com/thomas-krenn/check_lsi_raid.git
synced 2026-02-21 11:18:41 +01:00
Only set status to Warning if not alread Critical
This commit is contained in:
@@ -258,7 +258,7 @@ sub getControllerStatus{
|
||||
push @{$statusLevel_a[2]}, 'ROC_Temperature';
|
||||
}
|
||||
elsif(!(checkThreshs($1, $C_TEMP_WARNING))){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, 'ROC_Temperature';
|
||||
}
|
||||
$statusLevel_a[3]->{'ROC_Temperature'} = $1;
|
||||
@@ -266,14 +266,14 @@ sub getControllerStatus{
|
||||
}
|
||||
elsif($key eq 'Degraded'){
|
||||
if($foundController{$key} != 0){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, 'CTR_Degraded_drives';
|
||||
$statusLevel_a[3]->{'CTR_Degraded_drives'} = $foundController{$key};
|
||||
}
|
||||
}
|
||||
elsif($key eq 'Offline'){
|
||||
if($foundController{$key} != 0){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, 'CTR_Offline_drives';
|
||||
$statusLevel_a[3]->{'CTR_Offline_drives'} = $foundController{$key};
|
||||
}
|
||||
@@ -294,7 +294,7 @@ sub getControllerStatus{
|
||||
}
|
||||
elsif($key eq 'Memory Correctable Errors'){
|
||||
if($foundController{$key} != 0){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, 'CTR_Memory_correctable_errors';
|
||||
$statusLevel_a[3]->{'CTR_Memory_correctable_errors'} = $foundController{$key};
|
||||
}
|
||||
@@ -422,13 +422,13 @@ sub getLDStatus{
|
||||
}
|
||||
if(exists($LD->{'Consist'})){
|
||||
if($LD->{'Consist'} ne 'Yes' && $LD->{'TYPE'} ne 'Cac1'){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, $LD->{'ld'}.'_Consist';
|
||||
$statusLevel_a[3]->{$LD->{'ld'}.'_Consist'} = $LD->{'Consist'};
|
||||
}
|
||||
}
|
||||
if(exists($LD->{'init'})){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, $LD->{'ld'}.'_Init';
|
||||
$statusLevel_a[3]->{$LD->{'ld'}.'_Init'} = $LD->{'init'};
|
||||
}
|
||||
@@ -582,48 +582,48 @@ sub getPDStatus{
|
||||
}
|
||||
if(exists($PD->{'Shield Counter'})){
|
||||
if($PD->{'Shield Counter'} > $IGNERR_S){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, $PD->{'pd'}.'_Shield_counter';
|
||||
$statusLevel_a[3]->{$PD->{'pd'}.'_Shield_counter'} = $PD->{'Shield Counter'};
|
||||
}
|
||||
}
|
||||
if(exists($PD->{'Media Error Count'})){
|
||||
if($PD->{'Media Error Count'} > $IGNERR_M){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, $PD->{'pd'}.'_Media_error_count';
|
||||
$statusLevel_a[3]->{$PD->{'pd'}.'_Media_error_count'} = $PD->{'Media Error Count'};
|
||||
}
|
||||
}
|
||||
if(exists($PD->{'Other Error Count'})){
|
||||
if($PD->{'Other Error Count'} > $IGNERR_O){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, $PD->{'pd'}.'_Other_error_count';
|
||||
$statusLevel_a[3]->{$PD->{'pd'}.'_Other_error_count'} = $PD->{'Other Error Count'};
|
||||
}
|
||||
}
|
||||
if(exists($PD->{'BBM Error Count'})){
|
||||
if($PD->{'BBM Error Count'} > $IGNERR_B){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, $PD->{'pd'}.'_BBM_error_count';
|
||||
$statusLevel_a[3]->{$PD->{'pd'}.'_BBM_error_count'} = $PD->{'BBM Error Count'};
|
||||
}
|
||||
}
|
||||
if(exists($PD->{'Predictive Failure Count'})){
|
||||
if($PD->{'Predictive Failure Count'} > $IGNERR_P){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, $PD->{'pd'}.'_Predictive_failure_count';
|
||||
$statusLevel_a[3]->{$PD->{'pd'}.'_Predictive_failure_count'} = $PD->{'Predictive Failure Count'};
|
||||
}
|
||||
}
|
||||
if(exists($PD->{'S.M.A.R.T alert flagged by drive'})){
|
||||
if($PD->{'S.M.A.R.T alert flagged by drive'} ne 'No'){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, $PD->{'pd'}.'_SMART_flag';
|
||||
}
|
||||
}
|
||||
if(exists($PD->{'DG'})){
|
||||
if($PD->{'DG'} eq 'F'){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, $PD->{'pd'}.'_DG';
|
||||
$statusLevel_a[3]->{$PD->{'pd'}.'_DG'} = $PD->{'DG'};
|
||||
}
|
||||
@@ -637,19 +637,19 @@ sub getPDStatus{
|
||||
push @{$statusLevel_a[2]}, $PD->{'pd'}.'_Drive_Temperature';
|
||||
}
|
||||
elsif(!(checkThreshs($1, $PD_TEMP_WARNING))){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, $PD->{'pd'}.'_Drive_Temperature';
|
||||
}
|
||||
$statusLevel_a[3]->{$PD->{'pd'}.'_Drive_Temperature'} = $1;
|
||||
}
|
||||
}
|
||||
if(exists($PD->{'init'})){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, $PD->{'pd'}.'_Init';
|
||||
$statusLevel_a[3]->{$PD->{'pd'}.'_Init'} = $PD->{'init'};
|
||||
}
|
||||
if(exists($PD->{'rebuild'})){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, $PD->{'pd'}.'_Rebuild';
|
||||
$statusLevel_a[3]->{$PD->{'pd'}.'_Rebuild'} = $PD->{'rebuild'};
|
||||
}
|
||||
@@ -702,7 +702,7 @@ sub getBBUStatus {
|
||||
if ($line =~ /^Battery State/){
|
||||
$line =~ /([a-zA-Z]*)$/;
|
||||
if($1 ne 'Optimal'){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, 'BBU_State';
|
||||
$statusLevel_a[3]->{'BBU_State'} = $1
|
||||
}
|
||||
@@ -714,7 +714,7 @@ sub getBBUStatus {
|
||||
push @{$statusLevel_a[2]}, 'BBU_Temperature';
|
||||
}
|
||||
elsif(!(checkThreshs($1, $BBU_TEMP_WARNING))){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, 'BBU_Temperature';
|
||||
}
|
||||
$statusLevel_a[3]->{'BBU_Temperature'} = $1;
|
||||
@@ -732,7 +732,7 @@ sub getBBUStatus {
|
||||
elsif($line =~ /^Voltage/){
|
||||
$line =~ /([a-zA-Z]*)$/;
|
||||
if($1 ne "OK") {
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]},'BBU_Voltage';
|
||||
$statusLevel_a[3]->{'BBU_Voltage'} = $1;
|
||||
}
|
||||
@@ -764,7 +764,7 @@ sub getBBUStatus {
|
||||
elsif($line =~ /^Remaining Capacity Low/){
|
||||
$line =~ /([a-zA-Z]*)$/;
|
||||
if($1 ne "No") {
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]},'BBU_Remaining_capacity_low';
|
||||
$statusLevel_a[3]->{'BBU_Remaining_capacity_low'} = $1;
|
||||
}
|
||||
@@ -790,7 +790,7 @@ sub getBBUStatus {
|
||||
elsif($line =~ /^Over Temperature/){
|
||||
$line =~ /([a-zA-Z]*)$/;
|
||||
if($1 ne "No") {
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]},'BBU_GasGauge_over_temperature';
|
||||
$statusLevel_a[3]->{'BBU_GasGauge_over_temperature'} = $1;
|
||||
}
|
||||
@@ -857,7 +857,7 @@ sub getCVStatus {
|
||||
if($currBlock eq 'Cachevault_Info' && $line =~ /^State/){
|
||||
my @vals = split('\s{2,}',$line);
|
||||
if($vals[1] ne "Optimal") {
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, 'CV_State';
|
||||
$statusLevel_a[3]->{'CV_State'} = $vals[1]
|
||||
}
|
||||
@@ -869,7 +869,7 @@ sub getCVStatus {
|
||||
push @{$statusLevel_a[2]}, 'CV_Temperature';
|
||||
}
|
||||
elsif(!(checkThreshs($1, $CV_TEMP_WARNING))){
|
||||
$status = 'Warning';
|
||||
$status = 'Warning' unless $status eq 'Critical';
|
||||
push @{$statusLevel_a[1]}, 'CV_Temperature';
|
||||
}
|
||||
$statusLevel_a[3]->{'CV_Temperature'} = $1;
|
||||
|
||||
Reference in New Issue
Block a user