This Python script connects to a Cisco DNA Center server via the API, queries the inventory and then adds the hostname/ip as SSH sessions in Putty for all devices on the users machine. Windows only
This repository is featured on Cisco DevNet Code Exchange.
This script is using the Cisco Devnet DNAC sandbox always on lab. You can connect to the GUI and view the documentation on the devnet sandbox site.
If using your own DNAC, you will need to enable the API package via the "Platform", section in DNA Center, documentation can be found on the Cisco developer site.
- Clone the repo:
git clone https://gitlab.com/natilik/networking/dna-putty-sessions.git
- Modify
username
,password
andhostname
in thedna_devices_to_putty.py
file to connect to your preferred DNAC server. Note: Platform API package must be running (tested on 1.2.10) - At the command line:
C:\> cd dna-putty-sessions
C:\dna-putty-sessions> python -m venv venv
C:\dna-putty-sessions> venv\Scripts\activate
(venv) C:\dna-putty-sessions> pip install -r requirements.txt
(venv) C:\dna-putty-sessions> python dna_devices_to_putty.py
- Python 3.7.1
- Putty
dnacmodule.py
included in reporequirements.txt
included in repo:
Jinja2==2.10.1
requests==2.21.0
urllib3==1.24.2
xlrd==1.2.0
xlwt==1.3.0
- Expand to support other SSH applications e.g. SecureCRT
- Chris Salisbury - Initial work - nonstdout
This project is licensed under the GNU GPLv3 Licence - see the Licence.md and Notice.md file for details