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.  

Similar Messages

  • Prime Infrastructure importing templates

    Hi all,
    We have an existing WCS setup (7.0.240.0).
    I have built up a Prime Infrastructure server running release 1.3.0.20.
    Originally I was going to look at migrating our existing WCS configure but the two stage process (WCS -> NCS -> Prime) looked prone to errors. Dediced to skip it and concentrate and building up from blank slate.
    The only exception was the floorplan maps for Wifi, I was able to export these straight from WCS to Prime without any hicups.
    I then added our main WLC and assigned the APs to the correct maps.
    Sweet!
    Now I would like to get the templates going for our WLCs as i have a couple more to deploy. The issue is that I dont want to manually configure templates in Prime. WCS had the ability to import templates from an existing WLC, a goldern WLC config. I cant seem to find any doco indicating this ability. Anyone come across something similar or another way I might acheive?
    Cheers
    Chris

    From the Classic Theme:::
    Go to Configure> Controllers, Select the Controller(s), select Discover Templates from Controllers
    http://www.cisco.com/en/US/docs/wireless/prime_infrastructure/1.3/configuration/guide/ctrlcfg.html#wp2147938

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

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

  • Prime InfraStructure 2.2 Configuration Template error

    Hi All,
    I'm facing Configuration template error . I can add the CLI template then after i press on Deploy i get error message  and this is happening with all the CLI templates  . ( also Attached the error )
    The error message : "
    Template Deployment- Prepare and schedule : HA With Virtual IP
    There was an error while parsing and rendering the content. (updateLeftTreeOnce is not defined )
    The HA With Virtual IP Template Body as below :
    logging 10.30.2.252
    ip access-list standard VTY_ACCESS
    no deny any log
    permit 10.30.2.252
    deny any log

    We are facing the exact same issue. Here are the version :
    Cisco Prime Infrastructure
    Version : 2.2.0
    Build : 2.2.0.0.158
    We tried restarting the NCS services, but it doesn't help. We have the issue on differents PC and browsers. Users told me they got the issue before but it disappeared by itself. We will open a case about it.

  • How to deploy prime infrastructure template on selected interfaces/ports

    Hi,
    So I manged to create an port grouping (all ports which start with the description ACP)
    And I also managed to create a CLI-template with the a DB variable setup (see http://www.cisco.com/c/en/us/td/docs/net_mgmt/prime/infrastructure/2-0/user/guide/prime_infra_ug/create_temps.html#60783)
    My template:
    #foreach ($interfaceName in $InterfaceNameList)
    interface $interfaceName
         switchport trunk encapsulation dot1q
         switchport trunk native vlan 3
         switchport trunk allowed vlan 3-8
         switchport mode trunk
    #end
    But when I deploy this template it will apply to all the ports on that switch, I can't apply only to the ports in the port group
    Is it possible to fix this somehow?
    I can think of 3 ways:
    Use other menu than Deploy -> Configuration Tasks -> <select template> -> deploy..., Which is the correct one?
    Make an new DB variable which only select ports which start with the description "ACP", but I am on the dark how to create such a DB variable, I know I need to edit /opt/CSCOlumos/conf/ifm/template/inventoryTagsInTemplate/CLITemplateDbVariablesQuery.properties but I can't find the syntax/field description
    Use an "if construction" in the cli template, something like #if(${description} == "ACP" ...., but how precisely?
    Who can give me any tips?
    Thanks,
    Emiel Witteman

    Thanks for the reply.  Im aware that there are still gaps between LMS and Prime, I didn't see the ability to push a config to a port group as being a compliance feature, but I see what you are saying.
    What I don't get though is that your link (thanks again) bears no resemblance to the config/admin guide section in Prime.  Which in fact was in the NCS docs too (I haven't gone back any further to check).
    If its not supported then that's bad enough, but for Cisco to document what seems to be an NCS/Prime specific way to do this and leave it in when it doesn't work really is appalling.
    Im still hoping Cisco finally make a management tool without major gaps in it...  :-(

  • Prime Infrastructure 2.1.1 cannot add more than two interfaces in Dynamic Interface Controller Templates

    Cisco Prime Infrastructure is a damned nightmare of browser bugs (some features work in IE8, some in IE9, and some only in Firefox).  And I am not sure if what I am experiencing is a browser bug - or a real bug - or something that I was able to do before and can't any more?  I would love for someone to either explain why this is happening to me, or reproduce the bug!
    I'm running Prime 2.1.1.  I am doing this ...
    Configure > Controller Template Launchpad
    System > Dynamic Interface
    Select a command > Add interface (GO)
    Enter all the properties - roll to the bottom of the page, and click Apply to Controllers
    I have four controllers.  And normally I would add an interface for each controller.  But I can only create two out of the four.  It doesn't matter which two I choose.  When I click Add under Manage Interfaces for the third controller, I cannot click the Done button to apply it (see screenshot, attached).  I have found that if I change the VLAN to something else, it will let me save it.  But ... why?  I went back and reviewed all of my existing interface templates and I am not doing anything different.  Although, they were all created a long while ago using WCS 7.x.
    Any help, guidance, or confirmation of insanity would be appreciated.
    -Steve Ballantyne

    I doubt I will get any hits on this here but I always try.  I opened a TAC case.  I will come back and comment on whatever they find.

  • Prime Infrastructure 2.1. Configuration template deploy problem.

    Hello! I have a problem with the CLI template deployment on Cisco Prime. PI version is 2.1.
    There is the following template, which contains:
    logging on
    logging 10.10.10.10
    When I try to deploy it on the router 1800 IOS Version 12.3(14)T7 all is going well and the report I get the following:
    Device
    Status
    Transcript
    10.5.5.1
    Success
    configlet: logging on logging 10.10.10.10 response: terminal width 0 config t logging on logging 10.10.10.10
    But, when I try to deploy the same template on the router 3825 IOS Version 15.1(4)M5, the system issues the following error:
    Device
    Status
    Transcript
    10.5.5.2
    Failed
    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 : Enter configuration commands, one per line. End with CNTL/Z. MAIN_VOICE_gate(config)# Current expects : (MAIN_VOICE_gate:579|MAIN_VOICE_gate:579)\([^\)]+\)#\s*\z MAIN_VOICE_gate:579#
    In what may be the reason that Prime cannot deploy the configuration on IOS version 15.1?
    Thank you!

    Good day! Yes, maybe we have the same BUG
    https://tools.cisco.com/bugsearch/bug/CSCub57283
    but in the status written that it is Fixed and applies to releases 1.2 and 2.0, but we used version 2.1.

  • Cisco Prime infrastructure template undeploy

    Hi,
    I am new to cisco prime, I have create the new Trap receiver template and deployed to one of the wireless controller and saved the deployment
    Now I want to undeploy the templates, When I tried undeploying the templates for same wireless controller, I got the warning message stating "Failed to undeploy the template"
    Please advice on below points
    1. How to undeploy the templates in cisco prime infrastructure
    2. Where to find the snmp traps ( steps to check the snmp traps) in cisco prime.
    Please Help!!!!!

    Using System Logs
    Prime Infrastructure logs all error, informational, and trace messages generated by all devices that are managed by Prime Infrastructure.
    Prime Infrastructure also logs all SNMP messages and Syslogs it receives.
    You can download and email the logs to use for troubleshooting Prime Infrastructure.
    Step 1 Choose Administration > Logging. The General Logging Options Screen appears.
    Step 2 Choose a Message Level.
    Step 3 Check the check boxes within the Enable Log Module option to enable various administration modules. Check the Log Modules option to select all modules.
    Step 4 In the Log File Settings portion, enter the following settings. These settings will be effective after restarting Prime Infrastructure.
    Note The log file prefix can include the characters "%g" to sequentially number of files.
    Step 5 Click the Download button to download the log file to your local machine.
    Note The logs.zip filename includes a prefix with the host name, date, and time so that you can easily identify the stored log file. Included in the zip file is an html file that documents the log files.
    Step 6 Enter the Email ID or Email IDs separated by commas to send the log file.
    Note To send the log file in a mail you must have Email Server Configured.
    Step 7 Click Submit.

  • Cisco Prime Infrastructure 1.3 Template Application Logs

    So I'm pushing out a config template to my APs via CPI1.3 (Configure, Lightweight AP Configuration Templates; select template; select my APs, Apply).
    I get a "Partial Success" to a few of my APs. When I hit "Details" for these partial successes I get precious little details.
    So I go to check the server/appliance log (Administration, Logging, Download Log File). The log "file" is an archive of all logs on the appliance. All are in one folder of the archive, and the names are less than enlightening. Checking the most promising filenames does not seem to contain anything relevant to the push task.
    So, which log file do I look into for actual details of the results of an AP configuration template push?

    Using System Logs
    Prime Infrastructure logs all error, informational, and trace messages generated by all devices that are managed by Prime Infrastructure.
    Prime Infrastructure also logs all SNMP messages and Syslogs it receives.
    You can download and email the logs to use for troubleshooting Prime Infrastructure.
    Step 1 Choose Administration > Logging. The General Logging Options Screen appears.
    Step 2 Choose a Message Level.
    Step 3 Check the check boxes within the Enable Log Module option to enable various administration modules. Check the Log Modules option to select all modules.
    Step 4 In the Log File Settings portion, enter the following settings. These settings will be effective after restarting Prime Infrastructure.
    Note The log file prefix can include the characters "%g" to sequentially number of files.
    Step 5 Click the Download button to download the log file to your local machine.
    Note The logs.zip filename includes a prefix with the host name, date, and time so that you can easily identify the stored log file. Included in the zip file is an html file that documents the log files.
    Step 6 Enter the Email ID or Email IDs separated by commas to send the log file.
    Note To send the log file in a mail you must have Email Server Configured.
    Step 7 Click Submit.

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

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

  • 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

  • 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 Infrastructure 2.1 - Deploy Wireless Template

    As a test, I set up a simple template to push to one access point.  I am doing this in PI2.1.  Every time I try to deploy the template, it fails.  I cant figure out why.  So I am attaching a screenshot of the error and hope that some one else knows how to correct this issue.  TIA!

    http://www.cisco.com/c/en/us/td/docs/net_mgmt/prime/infrastructure/2-1/user/guide/pi_ug/create_temps.html

Maybe you are looking for