cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Cisco announces new innovations in SD-WAN, ISRs, SD-WAN Services, and Catalyst 9000 Series switches


89
Views
0
Helpful
2
Replies
Beginner

EEM script to unshut a interface with a delay after being admin downed

I'm new to EEM and how it functions, but I would love to learn. I'm trying to create a simple shutdown/no shutdown EEM script or scripts, but with a delay between the shutdown and no shutdown.

I recently tried using an initial applet to shut the interface, have the admin down syslog trigger another applet, and have that applet run a 3rd applet to no shut the interface... I can already tell that's way more convoluted than it needs to be, but as stated before I'm new to EEM.

Once the second applet runs/triggers for the admin down syslog I receive the error "Embedded Event Manager policy unshut-int not registered with event none Event Detector" 

%HA_EM-6-LOG: trigger : DEBUG(cli_lib) : : IN : switch#event manager run unshut-int
%HA_EM-6-LOG: trigger : DEBUG(cli_lib) : : OUT :
%HA_EM-6-LOG: trigger : DEBUG(cli_lib) : : OUT : Embedded Event Manager policy unshut-int not registered with event none Event Detector

Below are the applets that I have configured.

event manager applet shut-int
event none
action 001 cli command "enable"
action 002 cli command "config t"
action 003 cli command "interface Gi2/13"
action 004 cli command "shut"
action 005 cli command "end"
event manager applet trigger
event syslog pattern "Interface GigabitEthernet2/13, changed state to administratively down"
action 001 cli command "enable"
action 002 cli command "event manager run unshut-int"
action 003 cli command "end"
event manager applet unshut-int
event timer countdown time 5000
action 001 cli command "enable"
action 002 cli command "conf t"
action 003 cli command "interface Gi2/13"
action 004 cli command "no shut"
action 005 cli command "end"

I appreciate any help!

2 REPLIES
Highlighted
VIP Advisor

Re: EEM script to unshut a interface with a delay after being admin downed

Hello

You can use tracking instead with a delay 

 

track 10 interface xxx

delay xxx

event track 10

 

 



kind regards
Paul

Please don't forget to rate any posts that have been helpful.
Cisco Employee

Re: EEM script to unshut a interface with a delay after being admin downed

Have a look at How To Introduce Large Delays In EEM Policies  .  This will allow you to do what you want with very flexible delays.

CreatePlease to create content
Ask the Expert- Introduction to Network Design