I'm making a script (run by netwatch) to send me emails whenever the router is up/down, right? Well, there are some things that I'm unclear about, and am wondering if you guys can help. ^_^
1. I'm trying to make it so that the email would read "Router is down at dd-mm-yyyy hh:mm:ss", instead of just the "Router is down" that I have now.
Here's my current script:
Code: Select all
source=
:log info "Main Gateway is DOWN";
/tool e-mail send from="admin@myrouter.com" server="xxx.xxx.xxx.xxx"
body="Router is DOWN" subject="Router is DOWN" to="owner@myrouter.com"
2. I tried adding a flood ping before the "/tool e-mail send" line, like so:
Code: Select all
/tool flood-ping xxx.xxx.xxx.xxx
:log info "Flood ping commenced"
3. I also want to make it so that in the log, the color of the line changes, say to red if down, green if up.
Is that possible?
4. It seems that there are quite a number of false positives generated by the script, and I'm trying to get rid of them. I read in the wiki that there's this script:
Code: Select all
:local i 0;
{:do {:set i ($i + 1)} while �i < 5) && ([/ping 64.233.169.99 interval=3 count=1]=0)};
:if ($i=5 && [/ip route get [find comment="Default Route"] distance]=1) do={:log info "Main Gateway down";
/ip route set [find comment="Default Route"] distance=3}
Thanks much.