Triggered execution? Interface up/down etc

Is there a way to have scripts run on a triggered event rather than by scheduler?
In particular i’m looking for a way to run a script when an interface goes up or down

I can see this can be done on VRRP or PPPoE servers (via profile) but I actually need an event to run when the PPPoE Client interface goes down/up

Hey

To my knowledge not directly. There is the netwatch, with up & down scripts, but it’s no synchronous. It will not be triggered by event, but by (delayed) detection.

PPP profile works for servers and clients.


/ppp profile
add name=profile1 on-down="/log info \"Client disconnected\"" on-up="/log info \"Client connected\""
/interface pppoe-client
add name=pppoe-out1 profile=profile1 user=test

Result:


12:05:10 pppoe,ppp,info pppoe-out1: authenticated 
12:05:10 pppoe,ppp,info pppoe-out1: connected 
12:05:10 script,info Client connected  <------
12:05:19 pppoe,ppp,info pppoe-out1: terminating... - administrator request 
12:05:19 system,info device changed by admin 
12:05:19 pppoe,ppp,info pppoe-out1: disabled 
12:05:19 script,info Client disconnected  <------

Ah maybe it does work then. I’ll lab it up tomorrow and see how it goes

Nothing for ethernet though I presume?

Yep works perfectly, thanks

Sadly no. That’s on my wishlist as well.

When I try killing in active session do not execute on-down, any tip ?