07-07-2015 09:03 AM
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.
08-25-2016 09:53 PM
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 <configCmdConv><cliConv formatVersion="2">
<command>
<send>#INTERACTIVE</send>
<error>.*Incorrect usage.*</error>
</command>
<command>
<send>config ap group-name AAA_APG_Test AAA_AP_xx </send>
<error>.*Incorrect usage.*</error>
</command>
<command>
<send><IQ> Changing the AP's group name will cause the AP to reboot.</send>
<error>.*Incorrect usage.*</error>
</command>
<command>
<send>Are you sure you want to continue? (y/n) <R>y</send>
<error>.*Incorrect usage.*</error>
</command>
<command>
<send>#ENDS_INTERACTIVE</send>
<error>.*Incorrect usage.*</error>
</command>
</cliConv></configCmdConv></message><handlerCode>ERROR_CONFIG</handlerCode></palError>
01-26-2017 01:12 PM
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
07-24-2017 08:46 AM
Hi, have you found a solution to your problem, i'm experiencing the same kind of issue... (when mapping rf profile to apgroup)
Regards
07-24-2017 03:21 PM
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.
07-25-2017 12:16 AM
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) >
07-25-2017 03:42 PM
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
07-26-2017 02:14 AM
thank you for your answers and help, i'm gonna test it with the 3.1.3 at the office.
Have a nice day
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide