aboutsummaryrefslogtreecommitdiffstats
path: root/netwatch-notify
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-11-17 22:02:41 +0100
committerGravatar Christian Hesse <mail@eworm.de>2020-11-17 22:28:05 +0100
commit23923619dd0d92e4af65060e7b51b058fc1842aa (patch)
tree17f1becad63675c0d8978d8d8622dca6ee8b32aa /netwatch-notify
parente7855b4611f754fcde4f5adaff0e1a6006ddaaac (diff)
netwatch-notify: increase count for every parent in chain
Diffstat (limited to 'netwatch-notify')
-rw-r--r--netwatch-notify4
1 files changed, 3 insertions, 1 deletions
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 ];