Community discussions

MikroTik App
 
nemke
Member Candidate
Member Candidate
Topic Author
Posts: 160
Joined: Thu Jul 31, 2014 2:52 am

SMS Script for Internet down

Mon Oct 12, 2020 12:56 pm

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
 
netx34
just joined
Posts: 4
Joined: Sat Jan 13, 2018 1:43 pm

Re: SMS Script for Internet down

Sun Nov 29, 2020 1:51 pm

this is what i want also in my mikrotik but i dont know how to script for SMS notification, can i have also this ?
 
shahani
newbie
Posts: 26
Joined: Wed Jan 02, 2019 11:29 pm

Re: SMS Script for Internet down

Sat Dec 26, 2020 11:42 pm

Use tool > Netwatch
Image

Image
 
netx34
just joined
Posts: 4
Joined: Sat Jan 13, 2018 1:43 pm

Re: SMS Script for Internet down

Tue Dec 29, 2020 3:07 pm

your using usb modem dongle? or pocket wifi to send the sms ?
 
MxW
just joined
Posts: 2
Joined: Sun Dec 27, 2020 1:27 am
Location: Poznan, Poland

Re: SMS Script for Internet down

Tue Dec 29, 2020 7:34 pm

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.
 
kcavery001
just joined
Posts: 9
Joined: Mon Feb 22, 2021 5:59 am

Re: SMS Script for Internet down

Mon Feb 22, 2021 9:55 am

How to send also sms if the ISP has high ping and has slow internet connection and/or not totally down?

Who is online

Users browsing this forum: baragoon and 4 guests