diff options
author | Christian Hesse <mail@eworm.de> | 2020-07-17 08:07:12 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2020-07-17 08:12:00 +0200 |
commit | 075859c8986827b21c313affa896de814e3ae763 (patch) | |
tree | 9aecdc889603e6add0a0633e66a5b4c84d933452 /netwatch-notify | |
parent | 0e7b2d3ac735ca4922dc87671138297623ebd4bc (diff) |
global-functions: introduce and use $SymbolForNotificationchange-24
Diffstat (limited to 'netwatch-notify')
-rw-r--r-- | netwatch-notify | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/netwatch-notify b/netwatch-notify index 44f0657..0f464a9 100644 --- a/netwatch-notify +++ b/netwatch-notify @@ -11,7 +11,7 @@ :global ParseKeyValueStore; :global LogPrintExit; :global SendNotification; -:global SymbolByUnicodeName; +:global SymbolForNotification; :if ([ :typeof $NetwatchNotify ] = "nothing") do={ :set NetwatchNotify [ :toarray "" ]; @@ -32,7 +32,7 @@ :local Count ($Metric->"count"); :set ($Metric->"count") 0; :if ($Metric->"notified" = true) do={ - $SendNotification ([ $SymbolByUnicodeName "white-heavy-check-mark" ] . " Netwatch Notify: " . $HostName . " up") \ + $SendNotification ([ $SymbolForNotification "white-heavy-check-mark" ] . "Netwatch Notify: " . $HostName . " up") \ ("Host " . $HostName . " (" . $HostVal->"host" . ") is up since " . $HostVal->"since" . ".\n" . \ "It was down for " . $Count . " checks."); :if ([ :typeof ($HostInfo->"up-hook") ] = "str") do={ @@ -46,7 +46,7 @@ $LogPrintExit info ("Host " . $HostName . " (" . $HostVal->"host" . ") is down for " . \ $Metric->"count" . " checks.") false; :if ($Metric->"count" >= 5 && $Metric->"notified" != true) do={ - $SendNotification ([ $SymbolByUnicodeName "cross-mark" ] . " Netwatch Notify: " . $HostName . " down") \ + $SendNotification ([ $SymbolForNotification "cross-mark" ] . "Netwatch Notify: " . $HostName . " down") \ ("Host " . $HostName . " (" . $HostVal->"host" . ") is down since " . $HostVal->"since" . "."); :set ($Metric->"notified") true; :if ([ :typeof ($HostInfo->"down-hook") ] = "str") do={ |