

Cisco config backup Python script # Backup Cisco config I have an explanation of each line after the code.

Python ignores white space, but it makes it easier to read and understand. I have added comments and broken them into sections, separating the lines with a line of white space. Much of this was used in the previous script. Without further ado.Now, let us have a look at the script we will use. If this behavior is not desired, please comment out these lines: The script, as configured will export certificates. This was recently written by me, and appears to be "working for me" if you notice any problems please feel free to comment. You will need to set your path to the TFTP Root directory in the script. Those host names must be in the same folder as the backup script in a file called "asa_list.txt" Your ASA devices will need to resolve by their hostnames.

You will need to setup a username and password in the script as well as the address/hostname of your tftp server. If you do not agree to these terms you are prohibited from using this code on your system. I am not responsible for any damages, failures, disasters, catastrophes, data loss or any other failure resulting from the execution of this script on your system. The link is in the header section of the script. This script requires the SharpSSH library available from SourceForge. The main thing is it backs up the config and then zips it up. I haven't actually tested the restore via CLI function, but it SHOULD work. You will probably need to be ASA 8.3+ as there are some syntax differences in the webvpn config that will probably affect the backup if not.

It requires SharpSSH - The initial SSH functions I found on the internet ( here), the rest of the ASA specific functions I wrote. You could probably re-tool it to use SCP if you have a SSH server running on Windows, it may perform better. It runs on our 2008 server, which is running a free TFTP server. I also expanded it to capture the An圜onnect Client Profiles as well as Images, and export Certificates to provide the basic functionality obtained when using the ASDM Backup option. Here's a PowerShell script I wrote based on this: I would imagine your are leveraging the VPN capabilities of the appliance. For router/switch try have a script that runs and basically performs a copy run tftp.ĪSA is a little trickier if you are using it for anything other than firewall.
