cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1682
Views
0
Helpful
5
Replies

EEM Script to bounce all dot1x enabled ports after switch restart

tony.tran
Level 1
Level 1

Hi All,

 

I am trying to create an applet that bounces all dot1x enabled ports after a restart or reload. 

 

I will be using the following event - 

event snmp oid 1.3.6.1.2.1.11.0.0 get-type next entry-op gt entry-val 60 poll-interval 5

 

I need help with the actions to bounce all dot1x ports when event is detected.

 

Thanks!

5 Replies 5

Joe Clarke
Cisco Employee
Cisco Employee

What CLI commands would you use to bounce the ports manually?  What CLI would you use to detect a port is dot1x enabled?

I would use shut/no shut cli command to bounce the ports.

 

I need help with detecting dot1x ports. Right now, I m bouncing interface range and not dot1x selectively. Here is what I have so far.

 

! Applet to bounce ports when coldstart detected
event manager applet COLDSTART_BOUNCEPORTS
event syslog pattern "SYS-5-RESTART"
trigger delay 180
action 0.1 cli command "enable"
action 0.2 syslog msg "Switch experienced Cold Start - Bouncing dot1x Ports"
action 0.3 cli command "configure terminal"
action 0.4 cli command "interface range g0/2 - 52"
action 0.5 cli command "description added to port config by applet"
action 0.6 cli command "shut"
action 0.7 cli command "no shut"
action 0.8 cli command "end"

What CLI command would you use the determine if a port is dot1x-enabled?  What does the output of that command look like?

Yeah, that's the tricky part.

If I were to view the config for the interface, I would see "dot1x " commands. So the logic would be, if the interface contains "dot1x" commands, then bounce port.

Does "show dot1x all" list interfaces by name?  Parsing the config like this will be inefficient.

Review Cisco Networking for a $25 gift card