Submit a ticketCall us

WebinarUpcoming Webinar: How Help Desk and Remote Support Pays for Itself

Learn how help desk software can simplify ticketing management, allow you to track hardware and software assets, and accelerate the speed of IT support and service delivery. Gain insights on how remote support tools allow your IT team to maximize their efficiency and ticket resolution by expediting desktop troubleshooting, ultimately helping keep end-users happy and productive.

Register here.

Home > Success Center > Network Configuration Manager (NCM) > NCM 7.8 Administrator Guide > Config change template details

Config change template details

Created by Caroline Juszczak, last modified by Anthony.Rinaldi_ret on Oct 03, 2016

Views: 737 Votes: 0 Revisions: 5

A config change template named Change VLAN Membership on Ports Cisco IOS installs with SolarWinds NCM. Its purpose is to change VLAN membership on Cisco IOS device ports.

The following sections explain the specific components of a config change template by demonstrating how to use the Change VLAN Membership on Ports Cisco IOS template to make VLAN membership config changes on hypothetical Cisco device interfaces.

Viewed as parsable code, a config change template consists of two parts: parameters and commands. For more information, see Parts of a Config Change Template.

Example

This section assumes that you know how to make VLAN membership changes to device interfaces from the Cisco IOS command line. This section also assumes that you are familiar with using variables, data arrays, foreach loops, if/else conditional statements, and logical operators in creating system administration scripts.

The following sections show the reference template broken up into parameter, command, and output sections.

Parameters

These are the parameters for the Change VLAN Membership on Ports Cisco IOS template. Notice that the parameters already have values associated with them, which are either a string or a variable.

/*
.CHANGE_TEMPLATE_DESCRIPTION
	This change template configures VLAN membership on
	Cisco IOS devices.  The template was verified on
	Cisco 2950 Catalyst Switch running IOS software
	version 12.1(12c).
.CHANGE_TEMPLATE_TAGS
	Cisco, IOS, VLAN Membership
.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.

.PARAMETER_LABEL @TargetPorts
	Select Port(s)
.PARAMETER_DESCRIPTION @TargetPorts
	Select the port(s) for which you would like to
	change VLAN membership.

.PARAMETER_LABEL @VlansToRemove
	VLAN(s) to remove
.PARAMETER_DESCRIPTION @VlansToRemove
	Select the VLAN(s) to remove. Selecting VLANs
	irrelevant to interfaces results in no actions
	taken for those interfaces.

.PARAMETER_LABEL @VlanToAssign
	VLAN to assign
.PARAMETER_DESCRIPTION @VlanToAssign
	Select the VLAN you would like to assign.
*/

Commands

There is one instance of the script command and multiple instances of the CLI{ } command, and all variables have declarations.

script ConfigureVLANmembershipCiscoIOS (    
 NCM.Nodes @ContextNode, 
 NCM.Interfaces[] @TargetPorts, 
 NCM.VLANs[] @VlansToRemove,
 NCM.VLANs @VlanToAssign )
{
 // Enter configuration mode
 CLI 
 { configure terminal }
 
 // Loop through selected ports
 foreach (@portItem in @TargetPorts)
 {
  CLI
  { interface @portItem.InterfaceDescription } 
    
 // Loop through list of vlans to remove
 foreach (@vlanRemove in @VlansToRemove)
 {
  CLI 
   { no switchport access vlan @vlanRemove.VLANID }
 }
  CLI 
   { switchport access vlan @VlanToAssign.VLANID }
  CLI 
   { exit }
 }

 // Exit configuration mode
 CLI
  { exit }
}

Output Commands

These are the commands that NCM executes after logging on to the NCM device(s) selected as the target for this config change template. We are changing VLAN membership on one interface of two different Cisco switches.

bgp-2651-03

     configure terminal
     interface FastEthernet0/0
     no switchport access vlan 1004
     switchport access vlan 1002
     exit
     exit

cur-3725

     configure terminal
     interface FastEthernet0/1
     no switchport access vlan 1004
     switchport access vlan 1002
     exit
     exit

 

Last modified

Tags

Classifications

Public