Writing Custom VLAN Scripts

WhatsUp Gold ships with VLAN scripts for editing Cisco switches. You run these system scripts directly from the UI controls embedded in the VLAN Manager. You can also modify these scripts using percent variables.

Caution: Before you proceed, ensure that you understand VLANs, how they work, and verify the necessary controls are in place to validate (or rollback) any changes you make to your network's operating state before you run VLAN configuration scripts.

Note: VLAN changes to your network use custom (layer 3) instructions to bridge switches. They potentially enable devices on different layer 2 networks to share access to network-wide services and resources.

Tip: When you edit a system VLAN script, the CM System Script Library makes a copy. You can always revert back to the system script.

VLAN Item Iterator

You can use a percent variable that enables you to iterate through tagged VLANs or VLANs configured for the selected VLAN Trunk.

This iterator is supported by the following script types:

Syntax

@forEachItemInList

<Vlan-Or-Port-Operation>

@endfor

Example

@forEachItemInList

name $(Item.VlanName)

@endfor

Note: The Primary VLAN ID (PVID) cannot be tagged.

VLAN Item Variables

In each script type variables are supported within the command (@forEachItemInList), these variables always start with "Item." For example, $(Item.VlanIndex).

Name

Description

Item.VlanName

Supported item variables in Add VLANs, Edit VLANs, Delete VLANs, and Create VLAN Trunk scripts.

Item.VlanIndex

Item.PortName

Supported item variables in Assign ports to VLAN script.

Item.PortIndex

Item.VlanIndex
(Current VLAN the port is assigned to)

VLAN Properties

Name

Description

VlanName

Supported variables in Assign Ports to VLAN (these variables refer to the new VLAN the ports will be assigned to).

 

VlanIndex

PortName

Supported variables in Create VLAN Trunk and Delete VLAN Trunk

 

PortIndex

VlanName

Refers to the primary or native VLAN.

VlanIndex

Refers to the primary or native VLAN.

See Also

Using the Configuration Management VLAN Manager

Configuring VLAN trunks