From 23923619dd0d92e4af65060e7b51b058fc1842aa Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 17 Nov 2020 22:02:41 +0100 Subject: netwatch-notify: increase count for every parent in chain --- netwatch-notify | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'netwatch-notify') diff --git a/netwatch-notify b/netwatch-notify index 1cfd4a6..9a12c5a 100644 --- a/netwatch-notify +++ b/netwatch-notify @@ -50,9 +50,11 @@ :set ($Metric->"since") ($HostVal->"since"); :local Count [ $IfThenElse ([ :tonum ($HostInfo->"count") ] > 0) ($HostInfo->"count") 5 ]; :local Parent ($HostInfo->"parent"); - :if ([ :len $Parent ] > 0) do={ + :while ([ :len $Parent ] > 0) do={ :set Count ($Count + 1); + :set Parent ($NetwatchNotify->$Parent->"parent"); } + :set Parent ($HostInfo->"parent"); :local ParentNotified false; :while ($ParentNotified = false && [ :len $Parent ] > 0) do={ :set ParentNotified [ $IfThenElse (($NetwatchNotify->$Parent->"notified") = true) true false ]; -- cgit v1.2.3-54-g00ecf