cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
710
Views
10
Helpful
2
Replies

EEM to bounce ports

Adam-USA
Level 1
Level 1

Hi,

I want to use EEM code to bounce ports of two switches, but the code I have bounce only the first switch ports.

event manager applet port_bounce authorization bypass

event none sync yes maxrun 240

action 0010 set switch "1"

action 0020 cli command "enable"

action 0030 cli command "config t"

action 0040 while switch le 2

action 0060  set port "1"

action 0070  if $port le "5"

action 0080   cli command "interface Gi$switch/0/$port"

action 0090   cli command "shutdown"

action 0100   wait 5

action 0110   cli command "no shutdown"

action 0120   increment port 1

action 0130  else

action 0135   increment switch 1

action 0140  end

action 0145 end

!

I appreciate any help!

 

1 Accepted Solution

Accepted Solutions

Dan Frey
Cisco Employee
Cisco Employee

Place the "set port 1" outside the while loop.   port variable keeps getting set to 1 at each iteration.

View solution in original post

2 Replies 2

Dan Frey
Cisco Employee
Cisco Employee

Place the "set port 1" outside the while loop.   port variable keeps getting set to 1 at each iteration.

Adam-USA
Level 1
Level 1

Thank you Dan

Review Cisco Networking for a $25 gift card