From a79461aff2b4f18ed8b18f72388cb4c1573bad8e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 6 Jul 2020 15:44:41 +0200 Subject: netwatch-notify: add up hook for consistency Also this works around the permission/policy limitations in netwatch scripts. --- netwatch-notify | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netwatch-notify b/netwatch-notify index 350c088..0df92b5 100644 --- a/netwatch-notify +++ b/netwatch-notify @@ -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={ -- cgit v1.2.3-54-g00ecf