diff options
author | Christian Hesse <mail@eworm.de> | 2021-11-16 14:53:25 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-11-16 22:21:37 +0100 |
commit | d87c50cf68356e02e89620e445981776c7b4f4c3 (patch) | |
tree | 064cbfb02f799026576e0ee62e34038274d8f683 | |
parent | 185fe2c73035b66b2c8e0048eedca47fd438e3e6 (diff) |
check-health: indicate voltage increase or decrease
-rw-r--r-- | check-health | 4 | ||||
-rw-r--r-- | doc/check-health.d/notification-01-voltage.svg | 2 | ||||
-rw-r--r-- | global-functions | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/check-health b/check-health index bf0e441..9fef8bc 100644 --- a/check-health +++ b/check-health @@ -17,6 +17,7 @@ :global CheckHealthVoltagePercent; :global Identity; +:global IfThenElse; :global LogPrintExit2; :global ScriptLock; :global SendNotification2; @@ -46,7 +47,8 @@ $ScriptLock $0; :if ($CheckHealthLast->$Name * (100 + $CheckHealthVoltagePercent) < $Voltage * 100 || \ $CheckHealthLast->$Name * 100 > $Voltage * (100 + $CheckHealthVoltagePercent)) do={ $SendNotification2 ({ origin=$0; \ - subject=([ $SymbolForNotification "high-voltage-sign" ] . "Health warning: " . $Name); \ + subject=([ $SymbolForNotification ("high-voltage-sign,chart-" . [ $IfThenElse ($CheckHealthLast->$Name < \ + $Voltage) "in" "de" ] . "creasing") ] . "Health warning: " . $Name); \ message=("The " . $Name . " on " . $Identity . " jumped more than " . $CheckHealthVoltagePercent . "%.\n\n" . \ "old value: " . [ $FormatVoltage ($CheckHealthLast->$Name) ] . "\n" . \ "new value: " . [ $FormatVoltage $Voltage ]) }); diff --git a/doc/check-health.d/notification-01-voltage.svg b/doc/check-health.d/notification-01-voltage.svg index 81f7178..b762f61 100644 --- a/doc/check-health.d/notification-01-voltage.svg +++ b/doc/check-health.d/notification-01-voltage.svg @@ -151,7 +151,7 @@ y="0"><tspan x="180" y="10.85" - id="tspan13643">[MikroTik] ⚡ Health warning: voltage + id="tspan13643">[MikroTik] ⚡📉 Health warning: voltage </tspan><tspan x="180" y="25.85" diff --git a/global-functions b/global-functions index f5bca7a..19f5777 100644 --- a/global-functions +++ b/global-functions @@ -1035,6 +1035,8 @@ :local Symbols { "alarm-clock"="\E2\8F\B0"; "calendar"="\F0\9F\93\85"; + "chart-decreasing"="\F0\9F\93\89"; + "chart-increasing"="\F0\9F\93\88"; "cloud"="\E2\98\81"; "cross-mark"="\E2\9D\8C"; "fire"="\F0\9F\94\A5"; |