cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1380
Views
0
Helpful
1
Replies

HELP EEM

jaydiemoore
Level 1
Level 1

Im trying to use EEM to read the output of "show interface description | include TEST" to shutdown all the interfaces with the description TEST. Does anyone have any idea how to do this ?

1 Reply 1

Joe Clarke
Cisco Employee
Cisco Employee

Assuming you have new enough code, this should work for you:

event manager applet shut-TEST

event none

action 1.0 cli command "enable"

action 2.0 cli command "show int descr | inc TEST"

action 3.0 cli command "config t"

action 4.0 foreach line $_cli_result "\n"

action 4.1  regexp "^([A-Za-z0-9\.\:/]+).*TEST" $line match intf

action 4.2  if $_regexp_result eq 1

action 4.3   cli command "int $intf"

action 4.4   cli command "shut"

action 4.5  end

action 5.0 end

action 6.0 cli command "end"