Community discussions

MikroTik App
 
nemke
Member Candidate
Member Candidate
Topic Author
Posts: 112
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

Who is online

Users browsing this forum: No registered users and 12 guests