diff --git a/lib/amdgpu.pm b/lib/amdgpu.pm index bb79426..603e8eb 100644 --- a/lib/amdgpu.pm +++ b/lib/amdgpu.pm @@ -244,7 +244,7 @@ sub amdgpu_update { # amdgpu alert if(lc($amdgpu->{alerts}->{coretemp_enabled}) eq "y") { my $sensorIndex = 1; - $config->{amdgpu_hist_alert1}->{$n} = 0 + $config->{amdgpu_hist_alert1}->{$n} = 0 if(!$config->{amdgpu_hist_alert1}->{$n}); if($sensors[$sensorIndex] >= $amdgpu->{alerts}->{coretemp_threshold} && $config->{amdgpu_hist_alert1}->{$n} < $sensors[$sensorIndex]) { if(-x $amdgpu->{alerts}->{coretemp_script}) { logger("$myself: ALERT: executing script '$amdgpu->{alerts}->{coretemp_script}'."); @@ -257,7 +257,7 @@ sub amdgpu_update { } if(lc($amdgpu->{alerts}->{memorytemp_enabled}) eq "y") { my $sensorIndex = 2; - $config->{amdgpu_hist_alert2}->{$n} = 0 + $config->{amdgpu_hist_alert2}->{$n} = 0 if(!$config->{amdgpu_hist_alert2}->{$n}); if($sensors[$sensorIndex] >= $amdgpu->{alerts}->{memorytemp_threshold} && $config->{amdgpu_hist_alert2}->{$n} < $sensors[$sensorIndex]) { if(-x $amdgpu->{alerts}->{memorytemp_script}) { logger("$myself: ALERT: executing script '$amdgpu->{alerts}->{memorytemp_script}'."); diff --git a/lib/disk.pm b/lib/disk.pm index e9f1822..19b3e4f 100644 --- a/lib/disk.pm +++ b/lib/disk.pm @@ -267,8 +267,7 @@ sub disk_update { # DISK alert if(lc($disk->{alerts}->{realloc_enabled}) eq "y") { - $config->{disk_hist_alert1}->{$n} = 0 - if(!$config->{disk_hist_alert1}->{$n}); + $config->{disk_hist_alert1}->{$n} = 0 if(!$config->{disk_hist_alert1}->{$n}); if($smart1 >= $disk->{alerts}->{realloc_threshold} && $config->{disk_hist_alert1}->{$n} < $smart1) { if(-x $disk->{alerts}->{realloc_script}) { logger("$myself: ALERT: executing script '$disk->{alerts}->{realloc_script}'."); @@ -280,8 +279,7 @@ sub disk_update { } } if(lc($disk->{alerts}->{pendsect_enabled}) eq "y") { - $config->{disk_hist_alert2}->{$n} = 0 - if(!$config->{disk_hist_alert2}->{$n}); + $config->{disk_hist_alert2}->{$n} = 0 if(!$config->{disk_hist_alert2}->{$n}); if($smart2 >= $disk->{alerts}->{pendsect_threshold} && $config->{disk_hist_alert2}->{$n} < $smart2) { if(-x $disk->{alerts}->{pendsect_script}) { logger("$myself: ALERT: executing script '$disk->{alerts}->{pendsect_script}'."); diff --git a/lib/nvme.pm b/lib/nvme.pm index e9095fb..b0c6466 100644 --- a/lib/nvme.pm +++ b/lib/nvme.pm @@ -263,7 +263,7 @@ sub nvme_update { # nvme alert if(lc($nvme->{alerts}->{availspare_enabled}) eq "y") { my $smartIndex = 1; - $config->{nvme_hist_alert1}->{$n} = 0 + $config->{nvme_hist_alert1}->{$n} = 0 if(!$config->{nvme_hist_alert1}->{$n}); if($smart[$smartIndex] <= $nvme->{alerts}->{availspare_threshold} && $config->{nvme_hist_alert1}->{$n} < $smart[$smartIndex]) { if(-x $nvme->{alerts}->{availspare_script}) { logger("$myself: ALERT: executing script '$nvme->{alerts}->{availspare_script}'."); @@ -276,7 +276,7 @@ sub nvme_update { } if(lc($nvme->{alerts}->{percentused_enabled}) eq "y") { my $smartIndex = 2; - $config->{nvme_hist_alert2}->{$n} = 0 + $config->{nvme_hist_alert2}->{$n} = 0 if(!$config->{nvme_hist_alert2}->{$n}); if($smart[$smartIndex] >= $nvme->{alerts}->{percentused_threshold} && $config->{nvme_hist_alert2}->{$n} < $smart[$smartIndex]) { if(-x $nvme->{alerts}->{percentused_script}) { logger("$myself: ALERT: executing script '$nvme->{alerts}->{percentused_script}'.");