diff options
Diffstat (limited to 'check-health')
-rw-r--r-- | check-health | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/check-health b/check-health index 95a92d7..07ec366 100644 --- a/check-health +++ b/check-health @@ -21,8 +21,8 @@ :foreach Voltage in={ "battery"; "psu1-voltage"; "psu2-voltage"; "voltage" } do={ :if ([ :typeof ($CheckHealthLast->$Voltage) ] = "num" && \ [ :typeof ($CheckHealthCurrent->$Voltage) ] = "num") do={ - :if ($CheckHealthLast->$Voltage * (100 + $CheckHealthVoltagePercent) / 100 < $CheckHealthCurrent->$Voltage || \ - $CheckHealthLast->$Voltage > $CheckHealthCurrent->$Voltage * (100 + $CheckHealthVoltagePercent) / 100) do={ + :if ($CheckHealthLast->$Voltage * (100 + $CheckHealthVoltagePercent) < $CheckHealthCurrent->$Voltage * 100 || \ + $CheckHealthLast->$Voltage * 100 > $CheckHealthCurrent->$Voltage * (100 + $CheckHealthVoltagePercent)) do={ $SendNotification ("Health warning: " . $Voltage) \ ("The " . $Voltage . " on " . $Identity . " jumped more than " . $CheckHealthVoltagePercent . "%.\n\n" . \ "old value: " . [ $FormatVoltage ($CheckHealthLast->$Voltage) ] . "\n" . \ |