10-28-2014 03:20 AM
Hi,
Need a simple script (TCL/EEM) that backs up running-config of an ASR9k router on a daily basis.
Destination FTP och SFTP via a VRF
/Jorgen
11-04-2014 11:25 AM
this is maybe even nicer, we set a trigger on the MGBL commit from XR and then trigger a config backup right away:
event syslog pattern "%MGBL-CONFIG-6-DB_COMMIT : Configuration committed by user"
for more detail on the setup of eem check here:
https://supportforums.cisco.com/document/59496/using-embedded-event-manager-eem-ios-xr-asr9000-simulate-ecmp-min-links
here is an example script:
::cisco::eem::event_register_syslog
namespace import ::cisco::eem::* namespace import ::cisco::lib::* array set arr_einfo [event_reqinfo] if [catch {cli_open} result] { error $result $errorInfo } else { array set cli1 $result } array set _sinfo [sys_reqinfo_routername] set _info_routername $_sinfo(routername) if [catch {cli_write $cli1(fd) "copy run tftp"} _cli_result] { error $_cli_result $errorInfo } if [catch {cli_read_pattern $cli1(fd) "Address"} _cli_result] { error $_cli_result $errorInfo } if [catch {cli_write $cli1(fd) "w.x.y.z"} _cli_result] { error $_cli_result $errorInfo } if [catch {cli_read_pattern $cli1(fd) "filename"} _cli_result] { error $_cli_result $errorInfo } if [catch {cli_exec $cli1(fd) } _cli_result] { error $_cli_result $errorInfo } action_syslog msg # Close open cli before exit. catch {cli_close $cli1(fd) $cli1(tty_id)} result
02-15-2016 07:20 PM
I have this problem too
Can anyone help us?
02-15-2016 09:08 PM
What problem are you having? How about you configure the router to do the backup each time the config is changed, take a look at the following:
https://supportforums.cisco.com/document/12735651/xr-configuration-auto-backup
Regards
Eddie.
02-15-2016 11:05 PM
Thankyou!
But one more thing. When I use auto-save command there's a problem:
my ftp server's name: cisco
Password: snoc@123
When I excute the command: configuration commit auto-save filename ftp://cisco:snoc@123@192.168.1.1/config.cfg
The system cant understand the server IP 192.168.1.1 but 123@192.168.1.1
Is there anyway to troubleshoot this? (I cant change password because it is related to many other things).
Thanks!
02-15-2016 11:05 PM
Break it down as such and see if it works. Else you might need to change the password:
configuration commit auto-save filename ftp://123.29.0.147/config.cfg
ftp client password snoc@123
ftp client username cisco
let me know how it goes.
Eddie.
02-16-2016 12:46 AM
It's OK now.
Thanks verymuch!
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