From 2625cc09a5215c2f1f165197154a4c22f4ba6a3a Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sat, 13 Nov 2021 21:29:33 +0100 Subject: check-health: support hard lower limit for voltage ... to detect slow decrease of voltage, for example with UPS. --- check-health | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'check-health') 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.") }); + } } } } -- cgit v1.2.3-54-g00ecf