I have redone some of my previous backup scripts and consolidated them into a single backup and edit script that use a config file for the devices to backup. This script has several options to support cisco and Bluecoat devices. It has functions for tacacs, non-tacacs ssh and even good old telnet to back up devices.
The device-backup script relies on the perl Expect module for interaction. It performs a show version and a show run on cisco routers and switches (put into the backup file with the name and date stamp as part of the name). For ASA’s it sends a more system:running-config, and a show configuration noprompts for Bluecoats. I will add more comprehensive instructions in the future but wanted to get it posted.
Installation:
Basically, download the gz, tar -zxvf device-backup-v.x.tar.gz, make sure you have the correct perl modules installed. You may want to change the config directory to a different location that is in device-backup.pl. Use edit-devices.pl to create, add, modify and delete devices to be backed up (since the passwords are stored base64 encoded in the devices.conf file).
Note: as of Red Hat 6 you’ll need to make sure telnet is installed (since we try to connect to devices this way as well) or your script will error out and complain something like this:
Can’t call method “log_stdout” on an undefined value at ./device-backup.pl line 142, <DEVICES> line 9.
if so, just run ‘yum install telnet’. Thanks Kevin for catching that!