Hi All,
I have a problem with a script; it works good via shell but doesn’t work on system/script also if I import the code exactly as is.
{:if ([/routing bgp peer get [find name="CYMRU-1"] state] = "established") do={:global CYMRUSTATE;:delay 1;:set $CYMRUSTATE value="1";} else={:log error message="BGP Peer state not established"; /routing ospf instance set 0 distribute-default=never; :if ($CYMRUSTATE = "1") do={/tool e-mail send from=r1@mydomain.it server=X.X.X.X to=support@mydomain.it subject="BGP Peer down" port=25 body="BGP Peer down";:delay 1;:set $CYMRUSTATE value="0";}}}
When the peer is enstablished, it set the $CYMRUSTATE=1 (works); when the peer is idle it writes in log, it change OSPF instance but doen’t change $CYRMUSTATE to 0 and doesn’t send mail; same script copied and pasted in terminal works without problems,
WHY ? Any ideas ?