Community discussions

MikroTik App
 
bandi20
just joined
Topic Author
Posts: 3
Joined: Sat Feb 26, 2022 5:34 pm

if enable interface do something

Sat Feb 26, 2022 6:19 pm

Hello .. Can you help me to do a simple script to check if the device is still working, and if it is a true, do something?

I'd like to use this as an additional failover script to check if the failover interface is still working. If so, it will write an error in the log, which is automatically sent by e-mail

Thank you very much for your help.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3297
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: if enable interface do something

Sun Feb 27, 2022 5:59 pm

You can use Netwatch. Give an IP on the other side. If ip goes away, send email.
 
bandi20
just joined
Topic Author
Posts: 3
Joined: Sat Feb 26, 2022 5:34 pm

Re: if enable interface do something

Wed Mar 02, 2022 6:29 pm

Yes, I know, but I would like to check with this parameter in the script the entire interface (like ether 1) and whether it is specifically accessed through it, for example 8.8.4.4

something like this ([/ping 8.8.4.4 interface=ether1_WAN count=5] = 5) do={

but I would like to check is the inferface still ENABLE (not ping)
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3297
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: if enable interface do something

Wed Mar 02, 2022 7:04 pm

I do not understand. Interface do not Enable/Disable by it self. Some or a script needs to do the change of status of an interface.
 
bandi20
just joined
Topic Author
Posts: 3
Joined: Sat Feb 26, 2022 5:34 pm

Re: if enable interface do something

Wed Mar 02, 2022 10:56 pm

okay :)
in the failover script I have 2 states .. if everything works, the backup interface (GSM) is disabled .. if there is no internet from the main provider, the GSM interface is going to be enabled .. if the internet comes back from the main link, GSM goes to the disable state.

The task of this script is checking if the GSM interface is still on .. if so, every 10 minutes it sends a log error that sends an email

Who is online

Users browsing this forum: No registered users and 15 guests