Netwatch failover script

Hello, i have some problemas with netwatch script (it doesn’t woark, actually):

/ip route set [find comment="ISP1"] distance=1; 
/ip route set [find comment="ISP2"] disabled=yes;
:delay 5;
/ip  firewall  connection  remove  [find  dst-address=95.213.163.196];

I have ROS 6.32.3 and am i missing something? Mayby incorrect script syntax?

And one more question: is there a way to test scripts in some virtual environment, without actually testing them on running device?

If you create you netwatch scripts in /system script with name like “up” or “down” you can then run them and see if they work.

Then in /tool netwatch just specify the name of the script in the up and down menu’s .

EXAMPLE:

/system script
add name=up owner=admin policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive source=
“/log error "ip up"”
add name=down owner=admin policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive source=
“/log error "ip is down"”

/tool netwatch
add down-script=down host=8.8.8.8 up-script=up

Ohhh… It seems i misunderstood those big textboxes in /tool netwatch winbox window - i thought they should contain the script itself… Thank you.

Both ways work - I just like using seperate scripts so you can test them :slight_smile: