Error in wiki

I found some errors in the manual, I tried the last example on RouterOS v4 and I got syntax error.

http://wiki.mikrotik.com/wiki/Manual:Tools/Netwatch

The following works for me on RouterOS v4.

/system script add name=e-down source={/tool e-mail send from="rieks@mt.lv" server="159.148.147.198" body="Router down" subject="Router at second floor is down" to="rieks@latnet.lv"}



/system script add name=e-up source={/tool e-mail send from="rieks@mt.lv" server="159.148.147.198" body="Router up" subject="Router at second floor is up" to="rieks@latnet.lv"}



/tool netwatch add host=10.0.0.215 timeout=999ms interval=20s up-script=e-up down-script=e-down

I am probably being dense here, but what did you change? Those look exactly the same to me once you account for the wiki not being meant for straight copy/paste because of the multiline approach.

I removed two curly brackets {braces}.

add name=e-down source={/tool e-mail send {from="rieks@mt.lv" server="159.148.147.198" body="Router down" {subject="Router at second floor is down" to="rieks@latnet.lv"}



add name=e-up source={/tool e-mail send {from="rieks@mt.lv" server="159.148.147.198" body="Router up" {subject="Router at second floor is up" to="rieks@latnet.lv"}

Wiki examples does not have two sets of curly braces. Those examples are direct output form console and of course you can’t copy&paste them.

Okey, didn’t know that, it was the first time in ten years I copy & pasted from the manual.

What do you think about this example from the same example in wiki? system netwatch>


The manual says that it applies to RouterOS: v3, v4, v5 +

It’s in fact copy & pasted from earlier versions of RouterOS (see the links below). It goes back so far as RouterOS v2.4, but has been corrupted from version 2.7 to todays wiki.

RouterOS v2.9
http://www.mikrotik.com/testdocs/ros/2.9/tools/netwatch.php

RouterOS v2.8
http://www.mikrotik.com/testdocs/ros/2.8/system/scripting.php

RouterOS v2.7
http://www.mikrotik.com/documentation/manual_2.7/index.php

RouterOS v2.6

http://www.mikrotik.com/documentation/manual_2.6/index.php

RouterOS v2.5

http://www.mikrotik.com/documentation/manual_2.5/index.php

RouterOS v2.4

http://www.mikrotik.com/documentation/manual_2.4/index.php

Output from RouterOS v4:

add name=e-down policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive source="/tool e-mail send from=\
    \"rieks@mt.lv\" server=\"159.148.147.198\" body=\"Router down\" subject=\"Router at second floor is down\" to=\"rieks\
    @latnet.lv\""



add name=e-up policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive source="/tool e-mail send from=\"r\
    ieks@mt.lv\" server=\"159.148.147.198\" body=\"Router up\" subject=\"Router at second floor is up\" to=\"rieks@latnet\
    .lv\""

I’m a bit of a stickler for accuracy. :wink:
netwatch.pdf (25.6 KB)