I need bgp peer which "name" ends with "asr1" to be disable at site-A-router if icmp packet loss to WAN ip address at site-B-router is above 5%.
I tried to figure this out myself and ended up with script below, but it does not work
Code: Select all
# VARIABLES
:local asr1 "212.2.33.84";
:local pingCount 20;
:local stableConnectionFrom 95;
:local quality ([/ping count=$pingCount $asr1] * 100 / $pingCount)
# Connection quality check and bgp peers disable or enable
:if ($quality < $stableConnectionFrom) do={
/routing bgp peer disable [find where name~"asr1" and disabled=no]
}
elese={
do={/routing bgp peer enable [find where name~"asr1" and disabled=yes]
}
}