×

Warning message

  • Cisco Support Forums is in Read Only mode while the site is being migrated.
  • Cisco Support Forums is in Read Only mode while the site is being migrated.

HELP EEM

Unanswered Question
Jan 28th, 2014
User Badges:

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
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Joe Clarke Wed, 01/29/2014 - 06:00
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

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"

Actions

This Discussion