cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2153
Views
0
Helpful
7
Replies

Prime Infrastructure 2.2 CLI Templates with Interactive commands

Bill N
Level 1
Level 1

Hi,

Could anyone help me with P.I 2.2 Custom CLI templates?

I am trying to create a CLI template on PI 2.2 to copy running-config to slot0 on 4500 series switch using the hostname as a file name.

Actual commands are as simple as below but somehow I could not make it work on CLI template.

C4507#copy running-config slot0
Destination filename [c4507-confg]?
%Warning:There is a file already existing with this name
Do you want to over write? [confirm]

 

I also want to squeeze slot0 after saving the running config. But that also did not work.

C4507#squeeze slot0:
All deleted files will be removed. Continue? [confirm]
Squeeze operation may take a while. Continue? [confirm]

Thank you very munch in advance.

7 Replies 7

cameronreeves
Level 1
Level 1

I'm experiencing a similar issue with Prime 3.1. Has anyone been able to use interactive commands in Prime 3.1 in a similar scenario?

My experience:

From the Prime user guide:

An interactive command contains the input that must be entered following the execution of a command.

To enter an interactive command in the CLI Content area, use the following syntax:

CLI Command<IQ>interactive question 1<R>command response 1 <IQ>interactive question

2<R>command response 2

where <IQ> and <R> tag are case-sensitive and must be entered as uppercase.

For example:

#INTERACTIVE

crypto key generate rsa general-keys <IQ>yes/no<R> no

#ENDS_INTERACTIVE

 

 

The command line configuration behaves as follows:

(8510-Pri-Test) >config ap group-name AAA_APG_Test AAA_AP_xx

 

Changing the AP's group name will cause the AP to reboot.

Are you sure you want to continue? (y/n) y

 

 

My test:

#INTERACTIVE

config ap group-name AAA_APG_Test AAA_AP_xx <IQ> Are you sure you want to continue? (y/n) <R>y

#ENDS_INTERACTIVE

 

I have also tried including just the end ‘(y/n)’, both lines of the text, placing all text on a single line and some permutations of where spaces are.

 

Errors in Prime are along the following lines:

2016-08-25 15:57:39,981 [XDE ThreadPool 0] ERROR functions - <palError><deviceId>216167240289</deviceId><code>HANDLER_ERROR</code><message>Handler Error com.cisco.nm.pal.customhandler.cli.CLIHandler.  Invalid document given to handler &lt;configCmdConv&gt;&lt;cliConv formatVersion="2"&gt;

      &lt;command&gt;

           &lt;send&gt;#INTERACTIVE&lt;/send&gt;

           &lt;error&gt;.*Incorrect usage.*&lt;/error&gt;

      &lt;/command&gt;

      &lt;command&gt;

           &lt;send&gt;config ap group-name AAA_APG_Test AAA_AP_xx &lt;/send&gt;

           &lt;error&gt;.*Incorrect usage.*&lt;/error&gt;

      &lt;/command&gt;

      &lt;command&gt;

           &lt;send&gt;&lt;IQ&gt; Changing the AP's group name will cause the AP to reboot.&lt;/send&gt;

           &lt;error&gt;.*Incorrect usage.*&lt;/error&gt;

      &lt;/command&gt;

      &lt;command&gt;

           &lt;send&gt;Are you sure you want to continue? (y/n) &lt;R&gt;y&lt;/send&gt;

           &lt;error&gt;.*Incorrect usage.*&lt;/error&gt;

      &lt;/command&gt;

      &lt;command&gt;

           &lt;send&gt;#ENDS_INTERACTIVE&lt;/send&gt;

           &lt;error&gt;.*Incorrect usage.*&lt;/error&gt;

      &lt;/command&gt;

&lt;/cliConv&gt;&lt;/configCmdConv&gt;</message><handlerCode>ERROR_CONFIG</handlerCode></palError>

Ran into the same issue with 3.1.4 (patch 1). I was looking to deploy the command below (in bold):

aaa accounting identity default start-stop group radius
This operation will permanently convert all relevant authentication commands to their CPL control-policy equivalents. As this conversion is irreversible and will disable the conversion CLI 'authentication display [legacy|new-style]', you are strongly advised to back up your current configuration before proceeding.
aaa accounting identity default start-stop group radius
Do you wish to continue? [yes]:

After trial and error The following interactive CLI template worked:

#INTERACTIVE
aaa accounting identity default start-stop group radius<IQ>Do you wish to continue?<R>yes
#ENDS_INTERACTIVE

Andy

Hi, have you found a solution to your problem, i'm experiencing the same kind of issue... (when mapping rf profile to apgroup)

Regards

My issue with interactive commands was resolved in PI 3.1.3 - I would suggest you update to this PI patch version at a minimum, if not the latest version if possible.

Is your issue that interactive commands wont run, or that you are trying to run a specific interactive command?

Could you post up the contents of your script, and a copy of the output if you manually run the command on the network device? Could you please also include a copy of the error you are receiving.

Hello,

I am in PI3.1(.0 as far as I can see, I don't have any right to change that)

I did not try any other interactive commands, but I will today

here is my script

#INTERACTIVE
config wlan apgroup profile-mapping add testApGroup test-802.11a-ac-n
 <IQ>(y/n)<R> y
#ENDS_INTERACTIVE

the job appears in success, but nothing actually happened.

Here is the output of the job result :

"configlet:
#INTERACTIVE
config wlan apgroup profile-mapping add testApGroup test-802.11a-ac-n
(y/n) y
#ENDS_INTERACTIVE
 response:"

I think the answer (<R>) has just been skipped

I tried without spaces too, and a lot of other similar combination but I still have the same result.

Below is the command line in cli with ssh


(Cisco Controller) >config wlan apgroup profile-mapping add testApGroup test-802.11a-ac-n

Applying RF Profiles on an active AP Group will reboot all APs in the group.
Are you sure you want to continue? (y/n) y



(Cisco Controller) >

You will need 3.1.3 to support Interactive Commands.

Also, I had better luck with the following syntax (specifically the 'are you sure you want to continue') for prompts which include this entire line of text.

#INTERACTIVE
config wlan apgroup profile-mapping add testApGroup test-802.11a-ac-n<IQ>Are you sure you want to continue? (y/n) <R>y
#ENDS_INTERACTIVE

thank you for your answers and help, i'm gonna test it with the 3.1.3 at the office.

Have a nice day

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: