There is no need for script like that. Use netwatch feature of Mikrotik. It can ping specified address and if fails then run script to send mail or whatever you need.
Thanks pedja,
but I’ld like to know what is wrong in this simple script, somenthing syntax perhaps. I think that when there is some error, script does’nt execute from OS,
Cetalfio
I thought this but when I read scripting documentation I do’nt find a syntax error on my script but the script does not run and therefore the email doesn’t start.
You have to specify mail servers IP and from address also.
Can you send email just by typing these lines in console?
/tool e-mail send
to=“myemail@tiscali.it”
subject=([/system identity get name] . " Reboot Router 3")
That script works here. Well, it works like you have it written. If you change the ip to one that does not exist or does not answer a ping, it sends the email. Sent one to me anyway.