Writing Custom VLAN Scripts
- Last Updated: December 11, 2024
- 1 minute read
- WhatsUp Gold
- Version 2024
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.
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:
- Add VLANs, Edit VLANs, Delete VLANs
- Create VLAN Trunk
- Assign Ports to VLAN
Syntax
@forEachItemInList
<Vlan-Or-Port-Operation>
@endfor
Example
@forEachItemInList
name $(Item.VlanName)
@endfor
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. |