LMS 4.2.2 CLI TEMPLATE CREATION
Is there a way to apply the template based on the response of the IOS CLI?
Example:
Var1 = "show dot1x"
if var1 = disabled
then
dot1x system-auth-control
end
if
Thanks
Emiliano
thx Marvin for the reply, but I cant see the attachment.
I dont mean the own declared variables and I dont mean the compliance baseline templates. I mean the Template Center templates (analogue PI) and the global built-in variables that are also not documented inline in the ootb templates:
One example is $(interface) for the current deployed interface I got answered in a diferent threat in the past from Joe Clark.
But such important information belongs to a public product documentation. And that Im looking for.
Similar Messages
-
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
IsaacHello 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 -
How to use XDOXSLT in rtf template layout for etext template creation
<DEFINE CONCATENATION> BookDetails
<BASE LEVEL> Category
<ELEMENT> Name || '/' || Price
<DELIMITER> '/'
<END DEFINE CONCATENATION> BookDetails
With EFTProcessor the above details are created in xsl file as follows
<xsl:template name="CONCAT_BookDetails">
*I need to declare one more variable here
EG: <xsl:value-of select="xdoxslt:set_variable($mycount, count(.//Category))"/>
--and use this variable for any dyanamic process inside this template. How to achieve this in rtf template by declaring a xdoxslt function. How to declare this
syntax in rtf layout so that it creates a varibale in xsl template using the EFTProcessor. Please help me out. The main point here is to include xslt functions in
rtf template layout for etext template creation.*
<xsl:for-each select=".//Category">
<xsl:call-template name="CONCAT_BookDetails_V"/>
</xsl:for-each>
</xsl:template>in the next time use BI Publisher forum - BI Publisher
<?format-number(ENTERED_CR,'##,##0.00')?>it's works for me
output:
444 -> 444.00
444.55 -> 444.55 -
I'm in the process of trying to convert an existing gen1 VM (Win Server 2012 R2) to a VM template using VMM 2012 R2 with rollup 1. The creation keeps failing with the following error :-
"Error
(2901)The operation did not complete successfully because of a parameter or call sequence
that is not valid.Recommended ActionEnsure
that the parameters are valid, and then try the operation again."
I've checked that the local administrator account for the machine being converted to a template and it is blank as expected and in an attempt to troubleshoot I've output the template creation script via the VMM GUI and executed the commands in order which appears
to have resolved the problem, well the template finishes creation, i'm yet to deploy a machine via it?
# Create VM Template Wizard Script
# Script generated on Thursday, April 3, 2014 12:52:15 PM by Virtual Machine Manager
# For additional help on cmdlet usage, type get-help <cmdlet name>
$VM = Get-SCVirtualMachine -VMMServer localhost -Name "MyTemplate_Template" -ID "98299447-83e1-4d98-a558-a96ebafcf9b5"
| where {$_.VMHost.Name -eq "myhost.mydomain.com"}
$LibraryServer = Get-SCLibraryServer -VMMServer localhost | where {$_.Name -eq "my.library.com"}
$GuestOSProfile = Get-SCGuestOSProfile -VMMServer localhost | where {$_.Name -eq "Windows Server 2012
R2"}
$OperatingSystem = Get-SCOperatingSystem -VMMServer localhost -ID "50b66974-c64a-4a06-b05a-7e6610c579a2"
| where {$_.Name -eq "Windows Server 2012 R2 Standard"}
$template = New-SCVMTemplate -Name "My Template" -RunAsynchronously -VM $VM -LibraryServer $LibraryServer
-SharePath "\\mylibrary.mydomain.com\SCVMM Library\Templates\mytemplatedestination" -GuestOSProfile $GuestOSProfile -JobGroup d2f2f539-85da-4091-ab08-abe739fc4761 -ComputerName "*" -TimeZone 85 -FullName "Administrator"
-OrganizationName "My Organisation" -Workgroup "WORKGROUP" -AnswerFile $null -OperatingSystem $OperatingSystem
Now the only fields that weren't populated when I ran through the gui were FullName and Organization? Before I changed the script these two fields were just set to ""? Is that what has potentially caused the issue are they both required fields?Your not the only one who can reproduce this. Did you ever find out what it was? I saw your post and tried your same work-around and it also worked for me via Powershell.
-
Virtual desktop template creation with UR1 - two issues
There are two new issues affecting Virtual Desktop template creation with WMS 2012 with UR1.
Issue #1: Some systems fail to create a new or customized virtual desktop template with UR1 applied. UR1 includes an updated MultiPoint Connector which is compatible with a UR1 host. The Connector gets included in the Virtual Desktop template
so that the virtual desktops can be managed by MultiPoint Dashboard. On some systems installation of the UR1 Connector will require a reboot that takes too long to complete and template creation will timeout.
If you try to create a template without doing the following update to the unattend-t.xml file, and if the Connector reboot takes too long, the template creation process will never complete, appearing stuck at 80% until the timeout. If you check the running
Virtual Machine Connection, you will see an error message that Windows could not complete the installation.
To correct this:
From MultiPoint Manager or Hyper-V Manager, shutdown the running template VM.
Delete the template .vhd stored in Public Documents\Hyper-V\Virtual hard disks
3. a) Make a backup copy of
C:\Program Files\Windows MultiPoint Server\Unattend-t.xml
e.g. rename it .bak
b) open
C:\Program Files\Windows MultiPoint Server\Unattend-t.xml in your favorite text editor.
b) find “connector” in the file
c) replace this string (starts with <Path> and ends with </Path>)
<Path>powershell -Command "try { $process = Start-Process -FilePath '%Windir%\Temp\Connector\WmsConnector.Exe' -ArgumentList '/Quiet' -PassThru -Wait; } catch { throw 'WmsConnector
Install Failed'}; exit $process.ExitCode"</Path>
with this string
<Path>powershell -Command "try {
$p = Start-Process -FilePath '%Windir%\Temp\Connector\WmsConnector.Exe' -ArgumentList '/Quiet
/NoRestart' -PassThru -Wait; } catch { throw 'WmsConnector Install Failed'}; exit $p.ExitCode"</Path>
then save the file again as Unattend-t.xml
d) Proceed with Create and Customize virtual desktop template, and Create virtual desktop station as described on our blog at
Virtual Desktop Templates – Part
1 & Part 2
We continue to investigate why this issue occurs on some machines and not others
Issue #2: UR1 was intended to fix an issue creating virtual desktop templates on true UEFI systems, i.e. systems that don’t fall back to legacy support for earlier BIOS services. UR1 did not solve the issue. For now we are recommending
doing template creation on systems that do fall back to legacy BIOS services. To check: from Device Manager under Disk Drives select your system hard drive. Double click and go to the Volumes tab and click Populate. The Partition Style entry should
be Master Boot Record (MBR). If it is GPT you have a UEFI system.
We continue to investigate fixing this for UEFI systems.Any word on a UEFI fix? My instructions on the other thread seem to work for me.
Also, I imagine this won't be an issue on the next version of MultiPoint Server since the next Hyper-V in Server 2012 R2 now has those native UEFI VM's. Have you guys played around with that yet? Also, FWIW, I'm not sure why the pre-release docs
mention that UEFI is only supported on Windows 8 VM's. Why not x64 Windows 7 and Vista SP1 VM's? I thought those already support full UEFI boot. Is it because Hyper-V has mandatory restrictions to have Secure Boot turned on for UEFI VM's? -
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 :)
/ CarstenNot 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.) -
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. -
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.
ChristianNot 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 -
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. -
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?
ThanksHi ,
You can find that information ( job failure ) in the below log files::
>>> jobManager.log
>> ifm_jobscheduler.log
Thanks-
Afroz
***Ratings Encourages Contributors *** -
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
writedo copy running-config startup-config
produces the error:
copy not allowed in config mode or submode
so instead I used:
do wr -
Project Template Creation in CProjects
Hi,
This is regarding project template creation for CProjects.
I am now using the following BAPIs but not getting the templates created.
1. For project definition creation: BAPI_BUS2172_CREATE
2. For template creation: BAPI_BUS2170_CREATE
I am getting the project definition created but not the template created.
Please help.Hi,
You can get this done in the IMG under the 'spro' transaction. In Collaboration projects, get to create the role type and specify the project types (Regular, Program etc.) where this role type would be applicable.
Hope this helps... -
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# -
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
StephanWell, 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>#
Maybe you are looking for
-
Setting query datasource at runtime for FORM Datablock
Hello all, we have below requirement - the Form datablock is build on a customized table. we need to populate some of the fields of the form by writing a view which joins tables across variousl modules. the form data will be queried by giving po numb
-
Video Poblem with Bootcamp & XP
I just purchased the 21.5" iMac. I installed Windows XP in bootcamp and used a new Snow Leopard disk to install the drivers since I lost the install disks when travelling. My problem is I am trying to run RealFlight Sim and it tells me there is no 3D
-
According to Airport Utility > AirPort > Time Capsule, the name of my Time Capsule should be Time-Capsule.local. That's also how it appears when I click on "Edit ...". I don't have the dynamic global hostname option checked in the dialog that appears
-
This should help explain why songs don't appear where you expect them to be when you import them into iTurnes. (It's a repeat of an earlier post with some exposition for the casual user). iTunes appears to be looking for a combination of recording fo
-
Hi all, I'm a regular visitor of the Abap forum and I'm wondering if it would be possible to add some filters on the "standard overview". For instance: the number of posts (moreover replies) in the Abap forum is so large that posts without any reply