I found the variable. Here is what I have:
:local i value=0;
:while (($i <10) && ([/ping address=x.x.x.x interval=3 count=1]=0)) do={:set i value=($i+1)} ;
:if ($i=10) do={
:log info message=“Warning: 10 unsuccessful pings to IP x.x.x.x.”
:if ([/system resource get uptime] > 5m) do={
/tool e-mail send to=“tony@xxxx.com” subject=“down”;
}
}It works.
The “/system resource get uptime” variable prevents the script from sending the email upon router reboot. Let’s say you have 20 devices being monitored. Every time you reboot the router you would get 20 emails. That’s not fun. Setting this variable to more than 5 minutes eliminates the emails on startup.
Now if I could only ping 5 times and spread it out over 2 minutes, I would be happy!
Can you ping at intervals of 30 seconds? If so, how, and, does this hurt router performance?