Showing results for 
Search instead for 
Did you mean: 
Hall of Fame Community Legend

EEM Script: shut/no shut Cellular port

Can someone have a review if this is going to work or not?
I want the EEM script to kick in once the router can no longer ping the IP address.

ip sla 11
 frequency 15
ip sla schedule 11 life forever start now
ip sla enable reaction-alerts
ip sla reaction-configuration 11 react timeout action-type trapOnly threshold-type consecutive 4
event manager applet reset_Cell_port
event ipsla operation-id 11 reaction-type timeout
 action 1.1 cli command "enable" 
 action 1.2 cli command "config t" 
 action 1.3 cli command "interface Cellular0/2/0" 
 action 1.4 cli command "shutdown" 
 action 2.1 cli command "interface Cellular0/2/0" 
 action 2.2 cli command "no shutdown"
 action 3.1 cli end

Ideally, I want to a 10-second delay once the ping drops before the EEM script kicks in.

Thanks in advance.  

VIP Mentor

Re: EEM Script: shut/no shut Cellular port

it looks right but i always have to play around with these until get them working but from one of my previous eems we have saved we used this to cause a delay before the script kicked in, think actually Joe provided it that does be on the EEM section here --- action 0.4 wait 20 -- makes it wait 20 seconds before the next action kicks in , you could try that at the start even after it goes to enable

action 0.2 cli command "enable"
! action 0.3 cli command "send log PARSED IFNAME IS $ifname"
action 0.4 wait 20
action 0.5 cli command "show cdp neighbors $ifname detail"
action 0.6 regexp "(Phone)" "$_cli_result" value
Hall of Fame Community Legend

Re: EEM Script: shut/no shut Cellular port

Thanks, Mark.
Hall of Fame Cisco Employee

Re: EEM Script: shut/no shut Cellular port

Looking at your config, the timeout for a ping is 5 seconds.  You will run the probe every 15 seconds.  Your timeout requirement is that four consecutive pings fail.  So, after one minute of your host being unreachable, the applet will fire.  If you want an additional 10 second delay, then you can add:


action 1.0 wait 10


To your applet and increase its maxrun to 30 seconds.

Hall of Fame Community Legend

Re: EEM Script: shut/no shut Cellular port

Thanks, Joe. I'll have a look at this.
CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards