Prime 2.1 CLI-Template Copy to FTP

Hello everybody,
I want to write a CLI-Template to save the startup-config to a FTP-Server. So here ist my template:
#MODE_ENABLE
#INTERACTIVE
copy running-config ftp: <IQ>remote host<R>$ftpserver<IQ>filename<R>${IPAddress}.txt
#ENDS_INTERACTIVE
#MODE_END_ENABLE
My problem is: I want a filename, which include the hostname. Something like "switch-01-config.cfg". But I doesn't know the right way to get the hostname from a managed variable.
Finally I want to save configs from many switches to one ftp server I define.
 I hope someone can help me. Thanks in advance.
Christian

Not sure if this is possible, as the script may not be able get a unique input for each device to write it to FTP server.
But there is one option, where you can run a script on PI server which can fetch configuration from database for all the devices and dump it into a directory.
You can use this latest configs to be exported to another FTP server at once.
This seem to be one of the viable option on what you're trying to achieve. I can wait for other community members to share their expert suggestions.
-Thanks
Vinod

Similar Messages

  • Prime infrastructure 2.1.2 cli template "copy tftp://..." error

    I tried to copy a new ios image to several 3850 switche via CLI template but it failed.
    The template lokks like:
    #INTERACTIVE
    copy tftp://10.x.x.x/cat3k_caa-universalk9.SPA.03.06.02a.E.152-2a.E2.bin flash: <IQ>Destination filename [cat3k_caa-universalk9.SPA.03.06.02a.E.152-2a.E2.bin]? <R>
    #ENDS_INTERACTIVE
    The error message looks like:
    Error : Command returned an error : copy tftp://10.x.x.x/cat3k_caa-universalk9.SPA.03.06.02a.E.152-2a.E2.bin flash: ^ % Invalid input detected at '^' marker. SLT-EGDV4-255-4(config)#
    What is wrong here?
    Regards
    Stephan

    Well, from my point of view I've set up all things regarding ssh/scp correctly, but an upgrade via software deployment and ssh fails. Here is the logfile:
    ade # cat 10.142.255.5_scp_telnet.log
    dir /all flash:
    Directory of flash:/
    54210 -rwx 2097152 Apr 28 2015 08:01:10 +02:00 nvram_config
    69697 drwx 4096 Apr 16 2015 14:27:37 +02:00 dc_profile_dir
    54215 -rw- 10435 Apr 23 2015 14:04:01 +02:00 wnweb.tgz
    14 -rw- 1248 Apr 23 2015 15:02:23 +02:00 packages.conf.3-6
    54216 -rw- 82615244 Apr 23 2015 15:02:18 +02:00 cat3k_caa-base.SPA.03.06.02aE.pkg
    54222 -rw- 99253056 Apr 23 2015 15:02:19 +02:00 cat3k_caa-wcm.SPA.10.2.120.0.pkg
    15 -rw- 1248 Apr 28 2015 07:52:55 +02:00 packages.conf.3-5
    54218 -rwx 2296 Apr 17 2015 09:52:48 +02:00 vlan.dat
    54217 -rw- 4922044 Apr 23 2015 15:02:18 +02:00 cat3k_caa-drivers.SPA.03.06.02aE.pkg
    12 drwx 4096 Jan 6 2014 07:41:29 +01:00 mnt
    85188 -rw- 79122052 Feb 10 2015 08:44:16 +01:00 cat3k_caa-base.SPA.03.03.05SE.pkg
    85189 -rw- 6521532 Feb 10 2015 08:44:16 +01:00 cat3k_caa-drivers.SPA.03.03.05SE.pkg
    85190 -rw- 34530288 Feb 10 2015 08:44:16 +01:00 cat3k_caa-infra.SPA.03.03.05SE.pkg
    85191 -rw- 34846028 Feb 10 2015 08:44:17 +01:00 cat3k_caa-iosd-universalk9.SPA.150-1.EZ5.pkg
    85192 -rw- 25170832 Feb 10 2015 08:44:17 +01:00 cat3k_caa-platform.SPA.03.03.05SE.pkg
    85193 -rw- 77456192 Feb 10 2015 08:44:17 +01:00 cat3k_caa-wcm.SPA.10.1.150.0.pkg
    54219 -rw- 33756144 Apr 23 2015 15:02:18 +02:00 cat3k_caa-infra.SPA.03.06.02aE.pkg
    54220 -rw- 42882380 Apr 23 2015 15:02:18 +02:00 cat3k_caa-iosd-universalk9.SPA.152-2a.E2.pkg
    54221 -rw- 27362192 Apr 23 2015 15:02:18 +02:00 cat3k_caa-platform.SPA.03.06.02aE.pkg
    13 -rw- 1248 Feb 10 2015 08:44:22 +01:00 packages.conf
    1621966848 bytes total (1021952000 bytes free)
    SLT-EGDV4-255-5#software clean
    Preparing clean operation ...
    [1]: Cleaning up unnecessary package files
    [1]: No path specified, will use booted path flash:packages.conf
    [1]: Cleaning flash:
    [1]: Preparing packages list to delete ...
    In use files, will not delete:
    cat3k_caa-base.SPA.03.03.05SE.pkg
    cat3k_caa-drivers.SPA.03.03.05SE.pkg
    cat3k_caa-infra.SPA.03.03.05SE.pkg
    cat3k_caa-iosd-universalk9.SPA.150-1.EZ5.pkg
    cat3k_caa-platform.SPA.03.03.05SE.pkg
    cat3k_caa-wcm.SPA.10.1.150.0.pkg
    packages.conf
    [1]: Files that will be deleted:
    cat3k_caa-base.SPA.03.06.02aE.pkg
    cat3k_caa-drivers.SPA.03.06.02aE.pkg
    cat3k_caa-infra.SPA.03.06.02aE.pkg
    cat3k_caa-iosd-universalk9.SPA.152-2a.E2.pkg
    cat3k_caa-platform.SPA.03.06.02aE.pkg
    cat3k_caa-wcm.SPA.10.2.120.0.pkg
    packages.conf.3-5
    packages.conf.3-6
    [1]: Do you want to proceed with the deletion? [yes/no]: yes
    [1]: Clean up completed
    Than it fails back to TFTP which is working but taking lots of time... Attached is a screenshot of image management in PI.

  • Cisco Prime 2.1 CLI-Template for Switch configuration Backup

    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.

    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#

  • Prime 2.1 Logs CLI Template Jobs

    Hi,
    does anybody know by chance under which folder or in which file Prime writes executed CLI Template Jobs to troubleshoot failed jobs?
    Thanks

    Hi ,
    You can find that information ( job failure )  in the below log files::
    >>> jobManager.log
    >>  ifm_jobscheduler.log
    Thanks-
    Afroz
    ***Ratings Encourages Contributors ***

  • 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?

    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>#

  • CLI Templates in Prime

    I'm learning how to create CLI templates and have an easy question.
    A few weeks ago a created a very simple template that configured a logging server (Prime). It had two lines:
    logging facility syslog
    logging xxx.xxx.xxx.xxx  (IP of my Prime server)
    I wasn't sure if I needed to use the command 'configure terminal' or not and left it out. It turns out that Prime is smart enough to enter configure mode before running the commands but it did not write the new configuration and left all the switches with a mismatch between Run and Start.
    I'm now writing another simple template and don't know how to put in the write command. Do I just put that after some configure mode commands and trust that Prime is smart enough to exit configure mode before executing 'write' or should I explicitly put an 'exit' before 'write' ?
    This?:
    no logging event link-status
    write
    or this?:
    no logging event link-status
    exit
    write

    do copy running-config startup-config
    produces the error:
    copy not allowed in config mode or submode
    so instead I used:
    do wr

  • Prime Infrastructure - CLI Template - SmartPort Macro

    I'm hoping that someone can provide an example of a CLI Template for deploying a SmartPort Macro in Prime Infrastructure 2.0. I've tried multiple formats and can't seem to get it to work.
    Macro to be configured:
    macro auto execute TEST_MACRO {
         blah
         blah
         blahdeeblah
    Example 1 Template:
    #INTERACTIVE
    macro auto execute TEST_MACRO {
    <IQ><R>
    <IQ><R>blah
    <IQ><R>blah
    <IQ><R>blahdeeblah
    <IQ><R>}
    #ENDS_INTERACTIVE
    The above example runs successfully, however it does not actually produce a result.
    Example 2 Template:
    <MLTCMD>macro auto execute TEST_MACRO {
    blah
    blah
    blahdeeblah
    }</MLTCMD>
    The above example fails with the following result:
    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 : > >blah >blah >blahdeeblah >} mc-t307-acc06(config)# Current expects : blah blah blahdeeblah \}
    I'm sure that all my troubles stem from '>' result that is sent to the CLI after each line of the function is entered, however I can't seem to work around the problem.
    I've tried many more combinations without success... Any help would be appreciated.

    Instead of 
    #INTERACTIVE
    macro auto execute TEST_MACRO {
    <IQ><R>
    <IQ><R>blah
    <IQ><R>blah
    <IQ><R>blahdeeblah
    <IQ><R>}
    #ENDS_INTERACTIVE
    Try 
    <MLTCMD>
    macro auto execute TEST_MACRO {
    blah
    blah
    blahdeeblah
    </MLTCMD>
    This works for me.  

  • Cli templates prime 2.1

    HI
    I was wondering. Is it possible to run a CLI template that does the following.
    1. Running the CDP neighbor command to find out who the neighbors are.
    2. And automaticly entering a description command on the interface with the hostname and IP that it has found with the cdp neighbor command.
    Im having a big network where i have description on the trunk ports who they are linked to. With device name and IP.
    But im running through my network now trying to get the hostnames a bit better and more aligned.. But everytime i change a hostname i has to follow up on all the trunk ports to make sure the descriptions there are correct as well. Would be really cool if a cli template could do that job for me.
    Thanks :)
    / Carsten

    Not an answer per se but what you're describing reminded me of Prescriptive Topology Manager. It's built into Cumulus Networks' product and based on some open source work.
    Ethan Banks also has a nice article on it at his blog.
    (And - no, doing what you ask is not a feature that's available as of PI 2.1.)

  • Device reboot via CLI template in PI1.3

    Hi together,
    Is there any possibility to force a device (e.g. a switch/router) reload via Prime Infrastructure 1.3?
    I tried using a simple reload command via cli template, but it doesn't work for me.
    Thanks for your answers.
    Regards
    Sebastian

    Did you get anywhere with this?  I want to do something similar, configure just some port, not all ports.  Prime seems to work by deploying templates to device groups, but I want it to deploy by device and port groups.  Sadly it seems port groups are just monitoring filters only.
    There only appears to be 17 DB variables in Prime at the moment and none of them are interface description.
    I don't know if you can edit the CLITemplateDbVariablesQuery.properties file to add some more.
    I don't understand why the port of port groups isn't available to configuration deployment.

  • Does label template copy work at all?

    Hi,
    i hadn't time to investigate if this is a known problem, i must dash in 5 minutes, however i tried both on apex.oracle.com and on my local apex instance, both version 3.0.1, and i can't get the "label template copy" to work.
    I click on the copy icon on the right, i put the name of the new label template, i get the success message "template copied", but there is no trace of the new label template.
    All the report filters are disabled.
    Can someone else confirm this or am i just dreaming?
    Bye,
    Flavio
    http://www.oraclequirks.com

    Hello,
    Yup sure looks like a bug if you use that icon. Thanks for catching that.
    You can still copy the template using create and then picking
    Create
    Label
    As a Copy of an Existing Template
    Carl

  • How do I know which commands have been pushed to switch by PI CLI template

    We have PI version 1.3. I tried to deploy the built-in CLI template "vlan" just to create a vlan. I run the template and input vlan ID and name. The job is shown as successful in PI but the vlan is not created on the switch. In the transcript part of the job history, it only shows "configlet:response: config t". Please see the attachment for the screen shot. How do I know which commands have been pushed to the switch by the CLI template? How does PI push the CLI template to the switch? via snmp or telnet? I tried to run "debug tacacs authentication" and "debug tacacs accounting" on the switch because the switch is configured for command authentication and command accounting but I don't see any commands in the debug. It looks PI did not push any commands to the switch. Please help me to troubleshoot this.
    Thanks.

    The MPEG 2 Playback Component required by Streamclip is an optional purchase.
    http://store.apple.com/us/product/D2187Z/A
    There are other converters that can handle MPEG-2 files; try Handbrake.
    Regards.

  • CLI template creator with variables - where to start

    Hello people !
    I would like to be able to create a template that checks a device hostname and  takes actions according to it - my goal is to enable Energy Wise Domains - one for every location.
    If I could have LMS4.2 to check the hostname of the device then would be easy to attribute the device to the aproppriate domain.
    Exam.
    Device hostname AAAA_switch1 - Domain 1
    Device hostname AAAA_switch2 - Domain 1
    Device hostname BBBB_switch1 - Domain 2
    I have read several threads about this but I am not being able to understand where is the best place to start.
    Any help would be most apprecciated and will be rewarded with the deserved points
    Thanks in advance
    Isaac

    Hello again
    I am moving forward on my quest and hope that someone will give me a hand at some point   - these are my first steps on XML on LMS so I'll probably do some not so clever remarks.
    Anyway to start I have created a cli template and exported it - that way I would have an XML file with the correct structure - I thought :).
    Even if I dont do any changes and try so simply import to LMS the file created on the template I get the error message:
    "Template import Failed. Unable to parse the XML file.Please ensure that the XML file is complaint to the schema."
    Any ideas on what could be causing this?
    many thanks
    Isaac

  • CLI Template to run Archive Command to upgrade 3750 Switch in Prime

    Does anyone have or know how to write a template to upgrade a mixed stack of 3750 switches in Prime Infrastructure 2.0?  Prime does not support upgrading a mixed stack yet, but it can be done from command line.
    the command line would be:
    archive download-sw /allow /overwrite tftp://10.30.2.14/3750efilename  tftp://10.30.2.14/3750filename

    Hi,
    Please check:
    1. You need to download the correct .tar image file;
    2. Copy it to the root of your FTP or TFTP server;
    3. Upload, extract and install the .tar file to the switches (I always use the /imageonly option, because I don’t need the html files for management);
    4. Reload the switch stack;
    Please use this command:
    sw-stack#archive download-sw /imageonly /overwrite /allow-feature-upgrade ftp://user:password@/image-file.tar
    The boot parameters are automatically changed to the new IOS firmware. You can check the boot parameters with the show boot command.
    Regards
    Dont forget to rate helpful posts.

  • Prime shows wrong cli credentials but they are good

    Hey!
    Prime discovered both Nexus 7k Core Router. All fine...
    On the first one Prime is getting all informations with entered CLI credentials in the device work centre.
    On the second Nexus it always shows "wrong cli credentials" but they are 100% correct.
    Login into the second Nexus via putty and the same credentials is also fine.
    I can't convince Prime tocollect the Informations from the second Nexus.
    Even ssh from prime cli to this device ist ok...
    Any ideas?

    ok, tried all that was said here. Nothing worked ... I do have banners, but no # sign ... removed them anyways ... then thinking about the banners might be causing issues for what PI expects ... (i do have my prompts changed to mask the platform) ... so i defaulted back to regular prompts ... WORKED !!!!
    So here is what works for me ... no banners, no custom prompts AND device added through the 'classic theme'.
    I presume the expectation is that the device begins with minimal config ... the rest is pushed through the config templates deployment. But have the developers thought of existing devices ? is it IOS version related (target device) or simply a bug.
    BTW, PI v2.1
    Edit --- needing to clarify, for some models (namely UC520) ... removed banner, custom prompts and i could add it comfortably through the Lifecycle interface.
    Others (3550), could be inserted easily with banners and custom prompts ... rather inconsistent, though at least , i have working recipes.
    Thanks for the help all :)

  • Cisco Prime 2.0 - CLI credential

    Hi PI Experts,
    Is CLI credential mandatory on Cisco Prime?
    What would happen if no dedicated CLI credential were configured on Prime to access Cisco network devices?
    Right now we use TACACS+ to login to Cisco switches and routers and use Radius to login to PI.
    However, our security policy prevents us from either creating a AD account on AD servers or creating a local TACACS+ user account on ACS server for PI appliance.
    So, when we do device discovery, if we want to use SSH/Telnet, we need to put in our own AD user credentials, then remove them after the discovery is done.
    Thanks
    Cedar

    Hi Ceder,
    What would happen if no dedicated CLI credential were configured on Prime to access Cisco network devices?
    why Telenet credentilas are required :
    Telnet Credential
    you can specify the Telnet credentials during discovery so that Prime  Infrastructure can collect the device configurations and fully manage  the devices. If you do not specify Telnet credentials in the discovery  settings, Prime Infrastructure discovers the devices but is unable to  manage the device until you specify the Telnet credentials.
    In  case you are using SSH  on your devices:
    SSH Credential
    For full device support via SSH, you must use SSHv2 with a 1024 bit key. You can configure SSH before running discovery.
    Telnet\SSH , credentilas would be required later on as well to Fetch the config , to push any template on the device etc..
    Thanks-
    Afroz
    [Do rate the useful post]
    ****Ratings Encourages Contributors ****

Maybe you are looking for