Community discussions

MUM Europe 2020
 
User avatar
Equis
Forum Veteran
Forum Veteran
Topic Author
Posts: 888
Joined: Mon Jun 06, 2005 6:48 am

Network Cable unplugged?

Thu Jul 05, 2007 2:10 pm

Hello

Is there a script I can run that will tell me if the network cable is unplugged on ether1?

I am making a 12v UPS and using a loopback cable to tell me if teh powers one or off (cable looped or not)

Thanks :-)
Last edited by Equis on Thu Jul 05, 2007 3:07 pm, edited 2 times in total.
 
User avatar
Equis
Forum Veteran
Forum Veteran
Topic Author
Posts: 888
Joined: Mon Jun 06, 2005 6:48 am

Re: Network Cable unplugged?

Thu Jul 05, 2007 2:32 pm

I got this so far
/interface ethernet monitor [/interface ethernet find name "ether5"] once do { 
:if ($status="no-link") do { 
/tool e-mail send to="equis@mymailadd.com.au" subject=("Power Failure At") body=("Power Failure at at") 
} 
}
is the ok?

I get error sending in log, need to find where to put smtp server
Would someone know where to put smtp server?

Thanks :-)



EDIT: /tool e-mail set



:-)
Last edited by Equis on Thu Jul 05, 2007 3:14 pm, edited 1 time in total.
 
User avatar
Equis
Forum Veteran
Forum Veteran
Topic Author
Posts: 888
Joined: Mon Jun 06, 2005 6:48 am

Re: Network Cable unplugged?

Thu Jul 05, 2007 3:08 pm

OK, Last problem

Can I get it to email ony when its changed?

It currently emails me every min :-(

Thanks
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5970
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Network Cable unplugged?

Thu Jul 05, 2007 3:25 pm

Set global variable which is set to true if email already sent. And set to false if link is ok :)
 
User avatar
Equis
Forum Veteran
Forum Veteran
Topic Author
Posts: 888
Joined: Mon Jun 06, 2005 6:48 am

Re: Network Cable unplugged?

Fri Jul 06, 2007 1:19 am

Thanks :-)

Who is online

Users browsing this forum: CZFan and 10 guests