cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2844
Views
0
Helpful
6
Replies

Cisco Prime 2.1 CLI-Template for Switch configuration Backup

hussein bakkar
Level 1
Level 1

Hello everybody,

I am trying to write a CLI Template in cisco Prime to save the running-configuration of our core switch to the FTP server, 

I have already configured the FTP username and Password in the core Switch 

ip ftp username cisco
ip ftp password cisco123

 

 

in Cisco Prime I have created a template as follow:

copy running-config ftp: 

$FTP_IP_addrress >> the FTP Server

$name                    >> the name of file and the date

After deploying this template on the core switch,

 

I received Error Msg in Prime as follow:

Error : Command returned an error : copy running-config ftp: 172.16.30.30 Run_Config_Core_19_2_2015 ^ % Invalid input detected at '^' marker. QAF-DC-4507-CORE(config)#
 
I know that the backup files can be fetched directly from Cisco Prime in the Configuration Archives, But also I need to test if we can take a backup directly to the FTP server using Prime.
 
 Thanks in advance.

 

6 Replies 6

bkennedy97
Level 1
Level 1

Hello Hussein,

 

First thing that I see is that you will need to tell Prime to run the commands from enable mode instead of global config mode which Prime will default to.

 

Here is a sample write memory config that I deploy to devices...

#MODE_ENABLE

write memory

#MODE_END_ENABLE

 

Here is a link to the doc that has some of the format available for employing this, which will need some interactive commands sent to it as well.

http://www.cisco.com/c/en/us/td/docs/net_mgmt/prime/infrastructure/2-0/user/guide/prime_infra_ug/create_temps.html#31705

 

Thank you Bkennedy for replying,

I changed my template to be as follow:

 

#MODE_ENABLE
copy running-config ftp: 

$Mgmt_IP_addrress

$name

#MODE_END_ENABLE

 

 

but still I am receiving Error like :

Error : Exception while sending interactive commands to device, Expect timeout: Failed to match expected device output due to Expect timeout current timeout 60000. Current output : Address or name of remote host []? Current expects : (DC-450.{0,30}|DC-4507-AGG)\([^\)]+\)#\s*\z DC-4507-AGG# 

 

 

I believe that we have to tell the Prime how to send the variables to Switch, because the switch is waiting for the remote host IP address and the destination file name???


DC-4507-AGG#copy running-config ftp:
Address or name of remote host []? X.Y.Z.W
Destination filename [dc-4507-agg-confg]?
% VRF table-id 0 not active
% VRF table-id 0 not active
Writing dc-4507-agg-confg !
24425 bytes copied in 1.500 secs (16283 bytes/sec)
DC-4507-AGG#

 

Hi,

 

I tried the following template and its working now :

 

#MODE_ENABLE
#INTERACTIVE

copy running-config ftp: <IQ>Address or name of remote host<R>X.Y.Z.W <IQ>Destination filename <R>test


#ENDS_INTERACTIVE
#MODE_END_ENABLE

 

thank you

Hi Hussein,

Good to know that it worked for you!  I was also testing this out and the same principle works for copy run start as well.

#MODE_ENABLE
#INTERACTIVE
copy running-config startup-config <IQ>Destination filename<R>startup-config
#ENDS_INTERACTIVE
#MODE_END_ENABLE

You also can still apply variables throughout your config in case you have other locations that need the config file,  as well as setting the file name that you want as well.  

Regards,

Brandon

Hello,

 

I'm glad to see this worked for you as I had attempted this today and was unsuccessful. I'm looking to take it one step further and grab the hostname from the switch to add the the name of the file. Have you attempted this or know how to do this?

 

Thanks,

Hi
Your template doesn't work. I tried the following template and its working now :
#MODE_ENABLE
#INTERACTIVE

copy running-config ftp://ali:abbaszadeh@ <IQ>Address or name of remote host<R>10.100.224.100<IQ>Destination filename <R>


#ENDS_INTERACTIVE
#MODE_END_ENABLE
!!!!!!!!!!!!!!!!!!!!!!!!!!!
ali is username
abbaszadeh is password
10.100.224.100 is ip of ftp server
Don't forget to use @