This script extracts the VLANs information from the SDN > ACI table, and uses it to replace the vlanId
in the Technology > VLANs table. It generates a CSV file with the following columns:
- hostname
- siteName
- vlanName
- vlanId
- status
- stdStatus
- Python 3.8 or higher
- IP Fabric platform with API access
- Python package:
ipfabric
- Clone this repository or download the
vlans.py
script. - Install the required Python package:
pip install ipfabric
-
Copy the
.env.sample
file and rename it to.env
:cp .env.sample .env
-
Open the
.env
file and set the following environment variables:IPF_URL
: Your IP Fabric platform URLIPF_TOKEN
: Your IP Fabric API tokenIPF_VERIFY
: (optional) Set to "True" to verify the SSL certificate. Default is "False".REPORT_OUTPUT
: (optional) Path to the output CSV file. Default is "vlan_report.csv".
-
Run the script:
python vlans.py
The script will generate a CSV file with the VLANs information. The file will be saved to the path specified in the REPORT_OUTPUT
environment variable.