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

Prime Infrastructure 2.1 CLI Template to TFTP Copy File?

I'm trying to run the following command on a range of devices:

copy tftp://10.10.10.10/new-acl.txt running-config

The command is in enable mode and interactive, it prompts for confirmation of the filename.

Here's the CLI template I've cobbled together:

#MODE_ENABLE
#INTERACTIVE
copy tftp://10.10.10.10/new-acl.txt running-config<IQ>Destination filename [running-config]? <R>running-config
#ENDS_INTERACTIVE
#MODE_END_ENABLE

However, it fails with:

Error : Exception while sending interactive commands to device, java.util.regex.PatternSyntaxException:Illegal character range near index 31 'Destination filename [running-config]? ' ^

I've tried escaping the string with single quotes, double quotes and backslashes for the []? characters, but nothing seems to work. Any advice from the community on how to proceed?

7 REPLIES
Cisco Employee

Hi, Can you try syntax like

Hi,

 

Can you try syntax like below :

copy  tftp://x.x.x.x/ipiac_qos_configuration_updates.txt  running<R>

 

Thanks-

Afroz

****Ratings Encourages Contributors ****

Thanks- Afroz [Do rate the useful post] ****Ratings Encourages Contributors ****
New Member

Nope. I wasn't sure if you

Nope. I wasn't sure if you implied that doing <R> without <IQ> would just blindly OK everything (which would be a cool less-than-documented feature), but that does not appear to happen either:

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 : Destination filename [running-config ]? Current expects : (<switchname>|<switchname>)\([^\)]+\)#\s*\z <switchname>#

Where <switchname> is the name of the switch I'm deploying to.

Cisco Employee

you will be deploying this

you will be deploying this template to that device Only so no need to specify the device ip..

 

above is the error you are getting when running the suggested command ?

Thanks- Afroz [Do rate the useful post] ****Ratings Encourages Contributors ****
New Member

Based on what I understood

Based on what I understood your suggestion to be, I changed the template from:

#MODE_ENABLE
#INTERACTIVE
copy tftp://10.10.10.10/new-acl.txt running-config<IQ>Destination filename [running-config]? <R>running-config
#ENDS_INTERACTIVE
#MODE_END_ENABLE

to:

#MODE_ENABLE
#INTERACTIVE
copy tftp://10.10.10.10/new-acl.txt running-config<R>
#ENDS_INTERACTIVE
#MODE_END_ENABLE

Deploying the new template resulted in the error:

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 : Destination filename [running-config ]? Current expects : (<switchname>|<switchname>)\([^\)]+\)#\s*\z <switchname>#
New Member

This is how I did it and it

This is how I did it and it seemed to work. I don't know if the #MODE_ENABLE works show I entered the command is if I were in Global Config. Also note no space between the question (<IQ> and the response <R>

#INTERACTIVE

do copy tftp://10.50.22.87/MOH/$MOHFilename flash:/media/$MOHFilename<IQ>/media/$MOHFilename<R>/media/$MOHFilename

telephony-service

moh flash:/media/$MOHFilename

Hope this helps

Cisco Employee

Hi Toivo,

Hi Toivo,

Sorry to dig up this old thread but did you end up getting this to work? I'd recommend you try to match a only sub-set of the entire string that you are expecting and avoid any characters that could be considered to be special. In this instance I'd try "Destination filename".

I was working on something similar to this (which is how I came across this thread) and matching on the above works for me. Can you please try the below and let me know if this works?

#MODE_ENABLE
#INTERACTIVE
copy tftp://10.10.10.10/new-acl.txt running-config<IQ>Destination filename<R>running-config
#ENDS_INTERACTIVE
#MODE_END_ENABLE

New Member

No, never got it to work, and

No, never got it to work, and I've since left that position (and they got Solarwinds instead), but thank you for the help! Hopefully it'll help out someone else. I'll also pass it on to my old team.

987
Views
5
Helpful
7
Replies
CreatePlease to create content