10-20-2022 12:09 PM
Hello all and thanks for your time and expertise. I work for an employer where time and resources are always limited so I've backed up our switch configs via a local TFTP server. The problem is this process is time consuming and we have a fair number of switches. Please let me know what product (or process) you would recommend to make my life easier relative to backing up our switch configs. Definitely willing to consider paying for a solution that is straight forward and gets the job done. Thank you very much for any advice and recommendations. We have mostly Cisco 3560G switches.
10-20-2022 12:42 PM
Hi there,
The solution with the owest overhead would be to write your own (python) script to log onto the device and copy the running config, or have the device initiate the copy to a remote location.
If scripting is not your area of expertise (there will be plenty of example scripts online...), then with a little bit of setup (or a docker container if you prefer) I would recommend using Ansible for this task. There are well established modules for config management (cisco.ios.ios_config module – Module to manage configuration sections. — Ansible Documentation) and again plenty of examples online. Take this one for example, which incorporates version control:
Backup Cisco Configuration by Ansible | by Razan Saad | Medium
or something slighly simpler:
GitHub - sanakess/ansible-cisco-backup: Ansible Cisco backup template
cheers,
Seb.
10-20-2022 03:05 PM
archive
log config
logging enable
hidekeys
path tftp://<TFTP_IP_ADDRESS>/config/$h-
write-memory
time-period 10080
Try this.
There are two ways to "back-up" the config:
10-21-2022 03:48 AM
Hello,
you could also use an EEM script that makes a backup each time the configuration actually changes. Below is a sample.
event manager applet BACKUP_CONF_TFTP
event syslog pattern "%SYS-5-CONFIG_I: Configured from"
action 0.01 info type routername
action 1.01 cli command "enable"
action 1.02 cli command "show clock"
action 1.03 regexp "(2[0-3]|[01][0-9]):([0-6][0-9]):([0-6][0-9])" "$_cli_result" time hour minute second
action 1.04 puts "$time"
action 1.05 puts "$hour"
action 1.06 puts "$minute"
action 1.07 puts "$second"
action 1.11 cli command "show clock"
action 1.12 regexp "(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([1-9]|0[1-9]|[1-2][0-9]|3[0-1]) (20[1-9][0-9])" "$_cli_result" time2 month day year
action 1.13 puts "$time2"
action 1.14 puts "$month"
action 1.15 puts "$day"
action 1.16 puts "$year"
action 2.01 cli command "configure terminal"
action 2.02 cli command "file prompt quiet"
action 2.03 cli command "do copy run tftp://10.0.0.10/$_info_routername-$year$month$day-$hour$minute$second.txt"
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide