mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-06-21 02:05:40 +02:00
netwatch-notify: increase count for every parent in chain
This commit is contained in:
parent
e7855b4611
commit
23923619dd
2 changed files with 5 additions and 2 deletions
|
@ -46,7 +46,8 @@ suppress notification if the parent host is down:
|
|||
/ tool netwatch add comment="notify, hostname=gateway" host=93.184.216.1;
|
||||
/ tool netwatch add comment="notify, hostname=example.com, parent=gateway" host=93.184.216.34;
|
||||
|
||||
Note that a configured parent increases the check count threshould by one.
|
||||
Note that every configured parent in a chain increases the check count
|
||||
threshould by one.
|
||||
|
||||
Also notification settings are required for e-mail and telegram.
|
||||
|
||||
|
|
|
@ -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 ];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue