Cisco IOS Embedded Event Manager (EEM)

Hello Aronne

Hmm, that can become involved. In order to achieve this, you need to determine which ports have the “DA” in their description. There is a command that matches a particular string that can be used.

action 3.2 cli command "show interface gigabitethernet 1/0/1"
action 3.3 string match "*description DA*" "$_cli_result"
action 3.4 puts "$_string_result

The above commands will output the results of the show interface command into the $_cli_result variable. Within that output, you will have the description.

The next command searches for a string match that contains the text “description DA” with any other text appended before and after. If it finds it, the variable $_string_result will be set to 1. Otherwise, it will be set to 0. The final command simply prints that value to the CLI. In your case, you can use that result in an if statement, to either apply the config you want to that interface or not to apply it.

More info about the string match command can be found here:

I hope this has been helpful!