Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

ASR 9000 configuration backup

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

 

Everyone's tags (1)
6 REPLIES
Cisco Employee

this is maybe even nicer, we

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
Xander Thuijs CCIE #6775 Principal Engineer ASR9000, CRS, NCS6000 & IOS-XR
New Member

I have this problem too

I have this problem too

Can anyone help us?

Cisco Employee

What problem are you having?

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. 

New Member

Thankyou!

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!

Cisco Employee

Break it down as such and see

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. 

New Member

It's OK now. Thanks verymuch!

It's OK now.

Thanks verymuch!

991
Views
0
Helpful
6
Replies
CreatePlease login to create content