netwatch-notify: add up hook for consistency

Also this works around the permission/policy limitations in
netwatch scripts.
This commit is contained in:
Christian Hesse 2020-07-06 15:44:41 +02:00
parent 1c10044b24
commit a79461aff2

View file

@ -34,6 +34,10 @@
$SendNotification ("Netwatch Notify: \E2\9C\85 " . $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={
$LogPrintExit info ("Running hook on host " . $HostName . " up: " . ($HostInfo->"up-hook")) false;
[ :parse ($HostInfo->"up-hook") ];
}
}
:set ($Metric->"notified") false;
} else={