Page 1 of 1

Event driven scripting?

Posted: Mon Jan 13, 2014 8:14 am
by essele
Hi,

I can't seem to find any mechanism for automatically calling a script as a result of certain events? (Other than traffic monitor and netwatch)

I would like to run a script when a pppoe link comes up, I know I can achieve the same result using netwatch or a regularly scheduled script, but I thought we ditched the idea of polling years ago! ;-)

Is there any event based way of doing this?

While I'm on the subject of scripting ... I see that Lua was introduced and then removed, that's a real shame ... are there any plans to relook at this?

Many thanks,

Lee.

Re: Event driven scripting?

Posted: Fri Jan 24, 2014 6:12 am
by amee
You may use scheduler. Try This:
/ sy sche add interval=5m name=schedule1 on-event="/ip firewall nat> :if ([ /interface pppoe-client get pppoe-out1 running] false) do={your script}"

Re: Event driven scripting?

Posted: Fri Jan 24, 2014 3:00 pm
by essele
Thanks for the response, but you've nicely indicated my point.

This checks every five minutes, which has two problems...

1. There could be a 5 min (I know it could be one min) delay.
2. We're polling!

The router knows exactly when the link has come up ... why not have an option to run a script at that time?

Lee.

Re: Event driven scripting?

Posted: Fri Jan 24, 2014 5:45 pm
by efaden
It doesn't exist. I put it in as a feature request before. I agree.. It would be great...

Sent from my SCH-I545 using Tapatalk