cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2196
Views
5
Helpful
11
Replies

Prime Infrastructure - CLI Template - SmartPort Macro

MARIO POIER
Enthusiast
Enthusiast

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.

11 Replies 11

AFROJ AHMAD
Cisco Employee
Cisco Employee

Hi Mario,

what kind of device is this , I mean the model no ?

Can you try to run the Template again after Shortening the HOSTNAME of the device  and see how it work.

**********Hostname Character 10 or less *************

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

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

The switch that I'm attempting to deploy to is a 2960 Series (2960-48TT-L) running 12.2(55)SE1.

I'm not exactly sure that I understand what you mean by running the template with a shorter hostname. The current hostname is: mc-t307-acc06. Upon deployment I really only have the option to select the device from a list which is the FQDN of the device.

Regards,

Mario

.

Hi Mario,

This is actully a BUG

Config push fails when the device name is long

CSCub57283

Workaround:Modify the device name to a small name. Deploy the template again to the device

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

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

Justin bollinger
Beginner
Beginner

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.  

Torrance Zeiler
Beginner
Beginner

Were you ever able to find a solution for this? I'm having the same experience at the moment.