This program is designed to export a Cisco DNAC device list and save them to an Excel sheet, device configurations and save them to text file, and network health and generate a bar chart.
- Installation
- Getting Started
- Usage
- Collected Data from Device List Response
- Use it for your DNA Center
- References
- Previews
$ git clone https://github.com/Tes3awy/Cisco-DNA-Center-Device-List.git
$ cd Cisco-DNA-Center-Device-List
$ pip install -r requirements.txt --user│ main.py
│ get_auth_token.py
│ get_device_list.py
│ get_device_config.py
│ get_network_health.py
│ export_device_list.py
│ export_device_config.py
│ export_network_health.py
│ notify.py
│ .env.example
│ requirements.txt
│ README.md
│ CONTRIBUTING.md
│ CODE_OF_CONDUCT.md
│ .pre-commit-config.yaml
│ .gitignore
│ LICENSE
│
├───.github
│ └───ISSUE_TEMPLATE
│ bug_report.md
│ feature_request.md
│
└───assets
preview.png
sandboxdnac2.cisco.com.jpg
script-logs.pngYou need to provide your Cisco DNA Center credentials in a .env file. Create a .env file from .env.example and DON'T delete the latter (Check Use it for your DNA Center section).
A
.envfile in the current working directory will override the.env.examplevalues.
Then run:
python main.pyVoila ✨! An Excel file is created automatically from the device list on Cisco DNAC in the current working directory, configuration files of those devices are created in configs/<DOMAIN>/<today>/<config_id>_<today>.txt, and a network health diagram (a bar chart with a legend) is created in net_health/<BASE_URL>-<today>.jpg.
Unlike handling text files,
XlsxWriterlibrary does not have the option of appending new data to an existing Excel file. So every time you run the script, the Excel file will be overwritten.
NOTE: You have to close the Excel program before re-running the script.
For Windows Users ONLY
You will be notified with a native toast notification upon script successful completion.

- Hostname
- Device ID
- Management IP Address
- Serial Number
- Mac Address
- Platform ID (Device Model)
- Software Version
- Role
- Up Time
- Last Update
- Reachability Status
This program is ready to be used for your deployed Cisco DNA Center.
Create a .env file from .env.example:
$ cp .env.example .envRepalce the .env file values with your Cisco DNA Center credentials.
Example:
.env
DOMAIN=10.10.1.1 # without a trailing slash (/)
PORT=443
BASE_URL=https://${DOMAIN}:${PORT}
USERNAME=root
PASSWORD=C1sco12345
SSL_CERTIFICATE=False # set to True ONLY if you have a valid SSL certificateAPI Endpoints
Documentation


