From f16ac2e9567d7a3d76ddb52fd403bf4ac7c9e8f3 Mon Sep 17 00:00:00 2001 From: Andreas Bachlechner <62039342+bachandi@users.noreply.github.com> Date: Fri, 10 Dec 2021 12:24:18 +0100 Subject: [PATCH] Revert "remove superfluous if lines #367" This reverts commit 41d5f6eab45818aafd94b809534513a4b1430b18. --- lib/amdgpu.pm | 2 ++ lib/nvme.pm | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/amdgpu.pm b/lib/amdgpu.pm index bb79426..94b9d6a 100644 --- a/lib/amdgpu.pm +++ b/lib/amdgpu.pm @@ -245,6 +245,7 @@ sub amdgpu_update { if(lc($amdgpu->{alerts}->{coretemp_enabled}) eq "y") { my $sensorIndex = 1; $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}'."); @@ -258,6 +259,7 @@ sub amdgpu_update { if(lc($amdgpu->{alerts}->{memorytemp_enabled}) eq "y") { my $sensorIndex = 2; $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/nvme.pm b/lib/nvme.pm index e9095fb..046a8ef 100644 --- a/lib/nvme.pm +++ b/lib/nvme.pm @@ -264,6 +264,7 @@ sub nvme_update { if(lc($nvme->{alerts}->{availspare_enabled}) eq "y") { my $smartIndex = 1; $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}'."); @@ -277,6 +278,7 @@ sub nvme_update { if(lc($nvme->{alerts}->{percentused_enabled}) eq "y") { my $smartIndex = 2; $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}'.");