06-16-2017 01:20 AM
Hi Team,
I am working on writing an EEM script for clearing dialer interfaces as they stop passing traffic(staying in Up state) randomnly after being cleared(via a cron job periodically) and require to be manually resetted(by clear int dialer ) multiple times, before they start passing traffic again. This happens on any random trial of clearing the interface.
The following is my EEM script till now :
ip sla 1
R1(config)# icmp-echo 100.1.1.1 source-interface dialer0
R1(config)# timeout 1000
R1(config)# frequency 5
R1(config)# ip sla schedule 1 life forever start-time now
ip sla 2
R1(config)# icmp-echo 100.1.1.1 source-interface dialer1
R1(config)# timeout 1000
R1(config)# frequency 5
R1(config)# ip sla schedule 1 life forever start-time now
track 1 ip sla 1
default-state up
track 2 ip sla 2
default-state up
event manager applet test1 authorization bypass
event track 1 state down
action 1 cli command "enable"
action 2 cli command "clear int dialer 0“
action 5 cli command "end"
event manager applet test2 authorization bypass
event track 1 state down
action 1 cli command "enable"
action 2 cli command "clear int dialer 1“
action 5 cli command "end”
{ IP address : 100.1.1.1 - PPP Peer ip }
Functionality :
I am thinking of running a loop with “track 1 down “ as a trigger, meaning that I'd like to clear the interface inside the loop, every time we find track 1 to be down(meaning ip reachability from dialer being down, in turn meaning dialer is not passing traffic). I'd like to do this separately for both the dialers. But I want to have a timer( maybe maxrun can help here) to run the loop to check the track after 1 min or 2 mins after clearing the interface(for it to re-establish its ppp connection and for its route to be added as the ppp peer for us to run ip sla for reachability or traffic passing check).
Any inputs from you would be very highly appreciated at this stage as this is my first EEM script. Thanks alot :)
06-16-2017 07:32 AM
I think you should read How To Introduce Large Delays In EEM Policies . This uses multiple policies to achieve the loop and timer you're looking for. I think this example would require only slight modification to work for you.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide