From 075859c8986827b21c313affa896de814e3ae763 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 17 Jul 2020 08:07:12 +0200 Subject: global-functions: introduce and use $SymbolForNotification --- netwatch-notify | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'netwatch-notify') 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={ -- cgit v1.2.3-54-g00ecf