Community discussions

MikroTik App
 
nemirko
just joined
Topic Author
Posts: 19
Joined: Sat Dec 01, 2012 10:52 pm

Ping fail + ping fail + send sms

Tue Nov 05, 2013 5:53 pm

I need to monitor some ip adress by ping on every 10s and if fails 3 pings in 30s then send sms by usb gsm modem on some phone,
and when ping is up again 3 times in 30s then send sms again with second sms to notify me that link is up :)
how to do that? :) thanks...
 
User avatar
SimonK
newbie
Posts: 48
Joined: Wed Jul 24, 2013 10:44 am
Location: Denmark
Contact:

Re: Ping fail + ping fail + send sms

Wed Nov 06, 2013 12:02 am

hi,

i use the netwatch funtion
/tools/netwatch

create a new netwatch -> insert ip, select time on ping time
in up:
paste this
/tool sms send "INTERFACE FOR SMS MODULE" "PHONE NUMER" message="THE MESSEAGE U WANT IN YOUR SMS"

in down:
paste this
/tool sms send "INTERFACE FOR SMS MODULE" "PHONE NUMER" message="THE MESSEAGE U WANT IN YOUR SMS"

in my case sms module is on usb2
 
nemirko
just joined
Topic Author
Posts: 19
Joined: Sat Dec 01, 2012 10:52 pm

Re: Ping fail + ping fail + send sms

Wed Nov 06, 2013 12:20 am

But netwatch send sms after one ping fail, I need to send SMS only if 3 pings fails in line

am I clear now? :)
 
nemirko
just joined
Topic Author
Posts: 19
Joined: Sat Dec 01, 2012 10:52 pm

Re: Ping fail + ping fail + send sms

Sat Nov 09, 2013 11:48 am

Anyone some suggestion??
 
User avatar
skot
Long time Member
Long time Member
Posts: 584
Joined: Wed Nov 30, 2011 3:05 am

Re: Ping fail + ping fail + send sms

Sun Nov 10, 2013 1:34 am

Create a schedule in System > Scheduler to run every 30s with the following script.
:local result [/ping 192.168.88.1 count=3]
:global status
:if ($result = 3 && $status != true) do={
  /tool sms send message="link up" phone-number=12345
  :set status true
} else={
  :if ($result = 0 && $status != false) do={
    /tool sms send message="link down" phone-number=12345
    :set status false
  }
}
 
nemirko
just joined
Topic Author
Posts: 19
Joined: Sat Dec 01, 2012 10:52 pm

Re: Ping fail + ping fail + send sms

Mon Nov 11, 2013 11:47 am

Thanks, work great :D :D :D
 
User avatar
indjov
just joined
Posts: 20
Joined: Fri Jun 03, 2016 12:23 pm

Re: Ping fail + ping fail + send sms

Fri Jun 03, 2016 12:33 pm

Hello,
and do I need to run a PPP interface 3g modem? to be able to work this script to check the ping and sending SMS?
 
kcavery001
just joined
Posts: 9
Joined: Mon Feb 22, 2021 5:59 am

Re: Ping fail + ping fail + send sms

Tue Feb 23, 2021 9:11 am

Create a schedule in System > Scheduler to run every 30s with the following script.
:local result [/ping 192.168.88.1 count=3]
:global status
:if ($result = 3 && $status != true) do={
  /tool sms send message="link up" phone-number=12345
  :set status true
} else={
  :if ($result = 0 && $status != false) do={
    /tool sms send message="link down" phone-number=12345
    :set status false
  }
}
sir what if ISP is high ping only and has slow internet connection? ISP is not totally down, how to send also notification sir via sms? thanks

Who is online

Users browsing this forum: notanial and 23 guests