Community discussions

MikroTik App
 
matthysdt
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 55
Joined: Tue Jun 01, 2010 11:19 am

Script to detect PPPoE Status change

Wed Sep 22, 2010 10:27 am

Can someone assist me with a script to detect when a PPPoE interface status becomes "Connected" ?
(or I can even check when it's route becomes active...)
This is all part of a greater failover system, and this is the last little bit I'm stuck with. :?

Regards!
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Script to detect PPPoE Status change

Wed Sep 22, 2010 10:46 am

You can get pppoe status
/interface pppoe-client monitor do={ 
  :put "status is $status";
}

 
Joele
just joined
Posts: 5
Joined: Fri Apr 22, 2011 12:57 pm

Re: Script to detect PPPoE Status change

Sat May 07, 2011 2:33 am

Soory for my english...
its ok..
You can get pppoe status
/interface pppoe-client monitor do={ 
  :put "status is $status";
}

but if i want to execute a script when the pppoe fail??
please help me an example type:
if $status<>connected  system script run pppoe_failed
tanks!!!
 
itesco
just joined
Posts: 5
Joined: Tue Aug 30, 2011 3:35 pm

Re: Script to detect PPPoE Status change

Wed Oct 05, 2011 2:59 pm

if it still needed, here's how I did it:
:local adslstatus [:pick [:tostr [:pick [/interface pppoe-client monitor UkrTel as-value] 0] ] 7 10]
adslstatus returned "con" if status is " connected"
 
ayufan
Member
Member
Posts: 334
Joined: Sun Jun 03, 2007 9:35 pm
Contact:

Re: Script to detect PPPoE Status change

Thu Apr 12, 2012 1:48 pm

Just for future reference:
/ interface pppoe-client {
	:global ExternalIP
	:local clientip
	:local clientstatus
	monitor External once do={:set clientip $"local-address"; :set clientstatus $status}
	:if ($clientstatus="connected" and $ExternalIP!=$clientip) do={
		:log info "External IP changed from $ExternalIP to $clientip"
		/ tool fetch url="http://freedns.afraid.org/dynamic/update.php\?<key>" dst-path=ExternalIP.txt
		:set ExternalIP $clientip
	}
}
 
sapin069
just joined
Posts: 3
Joined: Fri Feb 09, 2018 6:34 pm

Re: Script to detect PPPoE Status change

Sat Jan 05, 2019 4:31 pm

HEllo All,

I need to have a script that will e-mail me when a certain PPPoE account connect on my Server, I don't need it for disconnect only connect, as it is my installer account, it will let me know when an installer installs a new client, and will e-mail me

Let me know if such script is possible,

THank you

Who is online

Users browsing this forum: No registered users and 13 guests