/* .CHANGE_TEMPLATE_DESCRIPTION This template configures physical interfaces based on interface description .CHANGE_TEMPLATE_TAGS Cisco, interface, VLAN, description, properties .PLATFORM_DESCRIPTION Cisco IOS .PARAMETER_LABEL @ContextNode NCM Node .PARAMETER_DESCRIPTION @ContextNode The node the template will operate on. All templates require this by default. The target node is selected during the first part of the wizard so it will not be available for selection when defining values of variables. */ script ChangeInterfacesBasedOnDescription ( NCM.Nodes @ContextNode ) { int @MatchFound @MatchFound = 0 // Loop through selected interfaces foreach (@interfaceItem in @ContextNode.Interfaces) { if (@interfaceItem.InterfaceAlias contains 'aaa') { // Set command CLI { configure terminal interface @interfaceItem.InterfaceDescription no cdp enable } @MatchFound = 1 } if (@interfaceItem.InterfaceAlias contains 'bbb') { // Set command CLI { configure terminal interface @interfaceItem.InterfaceDescription no cdp enable } @MatchFound = 1 } if (@interfaceItem.InterfaceAlias contains 'ccc') { // Set command CLI { configure terminal interface @interfaceItem.InterfaceDescription no cdp enable } @MatchFound = 1 } if (@interfaceItem.InterfaceAlias contains 'ddd') { // Set command CLI { configure terminal interface @interfaceItem.InterfaceDescription no cdp enable } @MatchFound = 1 } if (@interfaceItem.InterfaceAlias contains 'eee') { // Set command CLI { configure terminal interface @interfaceItem.InterfaceDescription no cdp enable } @MatchFound = 1 } if (@interfaceItem.InterfaceAlias contains 'fff') { // Set command CLI { configure terminal interface @interfaceItem.InterfaceDescription no cdp enable } @MatchFound = 1 } } // Exit configuration mode CLI { exit } if (@MatchFound != 1) { CLI { ### NO MATCHES FOUND ### } } } |