diff options
author | Christian Hesse <mail@eworm.de> | 2021-11-13 21:29:33 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-11-16 22:21:37 +0100 |
commit | 2625cc09a5215c2f1f165197154a4c22f4ba6a3a (patch) | |
tree | 620fe7a9aff20d96a833ede2243cf466ea214bb1 /check-health | |
parent | d87c50cf68356e02e89620e445981776c7b4f4c3 (diff) |
check-health: support hard lower limit for voltagechange-69
... to detect slow decrease of voltage, for example with UPS.
Diffstat (limited to 'check-health')
-rw-r--r-- | check-health | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/check-health b/check-health index 9fef8bc..56413c1 100644 --- a/check-health +++ b/check-health @@ -14,6 +14,7 @@ :global CheckHealthTemperature; :global CheckHealthTemperatureDeviation; :global CheckHealthTemperatureNotified; +:global CheckHealthVoltageLow; :global CheckHealthVoltagePercent; :global Identity; @@ -52,6 +53,17 @@ $ScriptLock $0; message=("The " . $Name . " on " . $Identity . " jumped more than " . $CheckHealthVoltagePercent . "%.\n\n" . \ "old value: " . [ $FormatVoltage ($CheckHealthLast->$Name) ] . "\n" . \ "new value: " . [ $FormatVoltage $Voltage ]) }); + } else={ + :if ($Voltage <= $CheckHealthVoltageLow && $CheckHealthLast->$Name > $CheckHealthVoltageLow) do={ + $SendNotification2 ({ origin=$0; \ + subject=([ $SymbolForNotification "high-voltage-sign,chart-decreasing" ] . "Health warning: Low " . $Name); \ + message=("The " . $Name . " on " . $Identity . " dropped to " . [ $FormatVoltage $Voltage ] . " below hard limit.") }); + } + :if ($Voltage > $CheckHealthVoltageLow && $CheckHealthLast->$Name <= $CheckHealthVoltageLow) do={ + $SendNotification2 ({ origin=$0; \ + subject=([ $SymbolForNotification "high-voltage-sign,chart-increasing" ] . "Health recovery: Low " . $Name); \ + message=("The " . $Name . " on " . $Identity . " recovered to " . [ $FormatVoltage $Voltage ] . " above hard limit.") }); + } } } } |