this script dont seem to run on v3.25

:log info “Ping ZW0001 beginning now”
:local i 0; {:do {:set i ($i + 1); :put $i; :delay 2} while (($i < 5) && ([/ping 11.0.0.1 count=1 interval=5]=0)}; :if ($i=5) do={ :log info “ZW0001 is down!”

it should not. this works:

:log info “Ping ZW0001 beginning now”
:local i 0; {:do {:set i ($i + 1); :put $i; :delay 2} while (($i < 5) && ([/ping 11.0.0.1 count=1 interval=5]=0))}; :if ($i=5) do={ :log info “ZW0001 is down!” }

why do people use scripts to ping ? netwatch is built to do just that, and it can execute scripts based on up and down events…

People may not want to do things as soon as a device goes down.. if I have a wireless link that drops the occasional packet every now and again (under 1%) I don’t want a netwatch script running at the times it does.

The script above pings something 5 times and will only trigger if all 5 packets are dropped.

thanks didnt see that always somthing small

can somebody please have a look at this im still not getting this right



so this is right!

:log info “Ping ZW0001 beginning now”
:local i 0; {:do {:set i ($i + 1); :put $i; :delay 2} while (($i < 5) &&
([/ping 11.0.0.1 count=1 interval=5]=0))}; :if ($i=5) do={ :log info “ZW0001
Down!..”
/tool e-mail send to=“xx@volxx.co.za” subject=([/system identity get
name] . " Backup")
from=server@network.com server=xxx.xxx.xxx.xxx
body=" router down at $[/system clock get time]
$[/systen clock get date]";
:log info “Finished Script!” }

don’t post the same message in different topics!

I answered in another one…