Page 1 of 1

SMS Script for Internet down

Posted: Mon Oct 12, 2020 12:56 pm
by nemke
Hello
I have 2 internets on router (eth1 and eth2) failover option. Both have static IP addresses so in route first ISP have Distance 1 and Second Distance 2. And that work good.
BUT I like to have script tahr SEND SMS to me, when thereis no first Internet (eth1). ISP modem is bad so offenly need to be reboot-ed
Example sctipt:

:if ([/ping interface=ether1 count=5 address=8.8.8.8 interval=5s]=0) do={
:log info "SBB Internet DOWN"
/tool fetch mode=http http-method=post url="http://xx:xxx:xx:xx:9998/\?username=XXXXXX&pw=XXXXX&clientaddress=XXXXXXXX&message=First Internet DOWN" keep-result=no
}

but problem is that everty time that script is run (schedule 15min) I got SMS. Idon't want that, ONLY to receve one SMS after condion (no ping to 8.8.8.8 from interface eth1 for 5 times with interwal of 5s). And one when I reboot ISP modem and there is ping over eth1.

How to solve this ?

Many thanks

Re: SMS Script for Internet down

Posted: Sun Nov 29, 2020 1:51 pm
by netx34
this is what i want also in my mikrotik but i dont know how to script for SMS notification, can i have also this ?

Re: SMS Script for Internet down

Posted: Sat Dec 26, 2020 11:42 pm
by shahani
Use tool > Netwatch
Image

Image

Re: SMS Script for Internet down

Posted: Tue Dec 29, 2020 3:07 pm
by netx34
your using usb modem dongle? or pocket wifi to send the sms ?

Re: SMS Script for Internet down

Posted: Tue Dec 29, 2020 7:34 pm
by MxW
Hello,

IMHO you can't use netwatch to proper WAN monitoring - it would generate alerts each time the single ping to Google fails, which could be quite often (a few times a day).

Therefore, my suggestion is to write a simple script with global variables pinging Google (or better: Cloudflare) in order to count series of ping fails, and raise alert only after crossing a certain threshold, e.g. 2 or 5 or 10 failed ping attempts in one string.

Re: SMS Script for Internet down

Posted: Mon Feb 22, 2021 9:55 am
by kcavery001
How to send also sms if the ISP has high ping and has slow internet connection and/or not totally down?