New script published to GitHub, a Cisco SG300 backup python script used to backup my SG300’s in my home lab.
The script uses Netmiko to handle the ssh connection. The configuration from each switch is saved to a TFTP server in my home lab.
I’ll shortly be adding an alternative version of the script which will save the config to a file as part of the ssh session.
Please note TFTP is NOT encrypted so care should be taken in assessing the risks of using TFTP to backup your switches. I use the TFTP option in my home lab as my switches reside on a dedicated vlan used for management. A Synology NAS provides the TFTP server and the configs are synced to a cloud drive using the Synology Cloud Sync application.
Prior to writing this Python script a combination of bash and expect scripts handled the ssh connection to the switches. Netmiko is cool project authored by Kirk Byers, a Multi-vendor library to simplify Paramiko SSH connections to network devices. Netmiko has enabled me to consolidate down to a single script.
Please note that the Cisco SG300 requires ‘ip ssh password-auth’ configured prior to using Netmiko.
Error checking and verification will be added to the script over time.
The Script can be found on GitHub here.