10-24-2015 10:13 PM
I'm writing a script to perform nightly configuration backup for all the Aruba S3500 switches. I'm using scp but cannot find the location of neither running- nor startup-config. Aruba indicates it is in flash: or maybe /flash but the following command does not seem to be able to find them there:
sshpass -p <password> scp -vv <user>@<switch_ip>:flash:running-config running-config
I have also tried but failed:
I tried also to create a backup for the flash -> flashbackup.tar.gz
dir shows the file there but
sshpass -p <password> scp -vv <user>@<switch_ip>:flashbackup.tar.gz flashbackup.tar.gz
still could not find the file...
Any idea what I did wrong?
Solved! Go to Solution.
10-25-2015 10:54 PM
The startup config is at /flash/config/default.cfg but you cannot get to it using scp from outside, neither the MAS or controller allows inbound SCP, only outbound (same for ftp, tftp etc.)
The other problem with using something like sshpass is that if you want to SCP out of the controller you need to be able to interactively enter the scp password.
to get the startup config out, use
copy flash: default.cfg tftp: 184.108.40.206 default.cfg
copy flash: default.cfg scp: 220.127.116.11 username /path/to/somewhere/default.cfg
It's better to backup the whole flash, as it will allow the controller to be rebuilt much faster if there is a need for it, i.e.
copy flash: flashbackup.tar.gz scp: 18.104.22.168 root /somewhere/flashbackup.tar.gz
copy flash: flashbackup.tar.gz tftp: 22.214.171.124 flashbackup.tar.gz
As for how to automate this, you can use expect or some other scripting language to automate this. There is likely freeware available for Cisco switches that will do the job. Another option is to automate via the webUI (there are freeware webUI automation tools around the place), where you can automate
1> nav to login -> maintenance -> file -> backup flash -> create backup (click) -> wait 1 minute
2> nav to file -> copy files -> flash filesystem (select flashbackup.tar.gz) -> tftp server (input ip/filename) -> Apply