if enable interface do something

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.

You can use Netwatch. Give an IP on the other side. If ip goes away, send email.

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)

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.

okay :slight_smile:
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