aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-07-17 07:49:42 +0200
committerGravatar Christian Hesse <mail@eworm.de>2020-07-17 07:52:56 +0200
commit4a5185ae28a120cc576d5566c54f093f80284db8 (patch)
tree02b4627c5c6d3597b68e64327732f5a72cdc5d30
parent1b55c9b5a2662ac187591c1f81dd541d88e70e9b (diff)
netwatch-notify: use $SymbolByUnicodeName
-rw-r--r--netwatch-notify5
1 files changed, 3 insertions, 2 deletions
diff --git a/netwatch-notify b/netwatch-notify
index 5b0c629..44f0657 100644
--- a/netwatch-notify
+++ b/netwatch-notify
@@ -11,6 +11,7 @@
:global ParseKeyValueStore;
:global LogPrintExit;
:global SendNotification;
+:global SymbolByUnicodeName;
:if ([ :typeof $NetwatchNotify ] = "nothing") do={
:set NetwatchNotify [ :toarray "" ];
@@ -31,7 +32,7 @@
:local Count ($Metric->"count");
:set ($Metric->"count") 0;
:if ($Metric->"notified" = true) do={
- $SendNotification ("\E2\9C\85 Netwatch Notify: " . $HostName . " up") \
+ $SendNotification ([ $SymbolByUnicodeName "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={
@@ -45,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 ("\E2\9D\8C Netwatch Notify: " . $HostName . " down") \
+ $SendNotification ([ $SymbolByUnicodeName "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={