Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

HELP EEM

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
Cisco Employee

HELP EEM

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"

306
Views
0
Helpful
1
Replies
CreatePlease to create content