diff options
author | Christian Hesse <mail@eworm.de> | 2020-07-06 15:44:41 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2020-07-06 15:44:41 +0200 |
commit | a79461aff2b4f18ed8b18f72388cb4c1573bad8e (patch) | |
tree | dc909a5ae55f38469a0e1796893440e8f829f6bb | |
parent | 1c10044b2430c4bd8ec5955ead84fbe282587bef (diff) |
netwatch-notify: add up hook for consistency
Also this works around the permission/policy limitations in
netwatch scripts.
-rw-r--r-- | netwatch-notify | 4 |
1 files changed, 4 insertions, 0 deletions
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={ |