08-22-2017 06:44 PM - edited 03-01-2019 06:05 PM
I am a new Cisco Prime user, so forigive my ignorance but is there a way to apply a standard config to multiple switch stacks all with varying switch members but excluding the uplink ports? So far I have not found a way to do this.
Any help would be benificial!
Thanks
08-23-2017 05:06 AM - edited 08-23-2017 05:06 AM
Hi yes you can through configuration change you can roll out whatever changes you want to all devices or some at the saame time
You can create custom configuration jobs in
Configuration / Templates / Features & Technologies
I have a list of ones i have created stored in PI in templates , that i can push out when needed , its very useful tool
|
CLI
|
My Templates/CLI Templates
|
2016-Dec-20 02:14:07 PST
|
|
CLI
|
My Templates/CLI Templates
|
2016-Dec-20 02:16:39 PST
|
|
CLI
|
My Templates/CLI Templates
|
2016-May-20 05:05:38 PDT
|
|
CLI
|
My Templates/CLI Templates
|
2017-Mar-21 02:59:20 PDT
|
|
CLI
|
My Templates/CLI Templates
|
2017-Jun-06 03:18:47 PDT
|
|
CLI
|
My Templates/CLI Templates
|
2017-Mar-21 04:27:42 PDT
|
|
CLI
|
My Templates/CLI Templates
|
2017-Mar-21 01:21:58 PDT
|
|
CLI
|
My Templates/CLI Templates
|
2017-Jun-06 04:21:07 PDT
|
|
CLI
|
My Templates/CLI Templates
|
I uploaded a screenshot of where you configure it , if this has helped please dont forget to rate the posts
08-23-2017 05:51 AM
I'm sorry, but maybe I am misunderstanding your reply. I know what Prime does and can do, however my speficific use is to be able to push out a set of standard configurations to switch stacks, all with varying members in the switch. So my challenge is that I can't use one interface range command, i need a script that will pull the number of switch members in the stack and create a script for that many interfaces, which are all access ports and leave out the trunk (uplink) ports.
Does this make more sense?
08-23-2017 06:00 AM
its not smart enough to pull that down for you first as far as im aware but if you know what each stack has like 4 or 5 switches you could build different templates for each stack , say stack of 4 switches 1 cli template and then stack of 6 switches another cli template and push out config like that
There is a compliance featuire which would allow you to run any customised reports against the device and pull back info for you of whats on the switch etc and then you could build a custom config template based agaisnt that but there not easy to script i have a few running that does checks against our device that check bgp ntp settings etc globally and reports back make sure noone has made any changes , you could the same with a stack but its a lot of work , lot quicker checking the switch stack then just pushing the config to it though than trying to build out compliance cehck and then config templates but thats your choice
12-22-2017 04:40 AM - edited 12-22-2017 06:08 AM
Hi,
Using DB variables it is possible to do something like what you're after. Although I haven't thought of a way to compute the interface range command yet you can write a script that loops through all access interfaces and applies commands to them.
First you'd need to edit the "CLITemplateDbVariablesQuery.properties" file in "/opt/CSCOlumos/conf/ifm/template/inventoryTagsInTemplate". Always make a backup of this file before editing!
To create a DB variable that selects access ports you could insert something like this at the end of the file:
accessPorts=select vlan.name from VLANSwitchportSettings vlan where (vlan.desiredVlanMode != '5' and vlan.operationalVlanMode != '5') AND vlan.name not like 'Port-%' AND vlan.owningEntityId =
I use VI to edit the file but if you're not comfortable with that you could transfer the file to your workstation and use whatever editor you feel like.
You can modify the 'where' criteria as you see fit, from what I've seen 5 is where 'switchport mode trunk' has been applied. You could also match on '2' for desiredVlanMode which appears to be fixed access. This example also excludes all port-channels, obviously you might not want that as you could have a port-channel in access mode.
Then in your CLI template you could add a DB variable called accessPorts (set the default value to accessPorts so it references your query). Example template code:
#foreach($int in $accessPorts) interface $int ! do something #end
As previously mentioned, you could also use the compliance policies to achieve this, the steps would be something like:
1) Match on 'interface'
2) Match on 'switchport mode access'
3) Match on 'your command'. Set a violates fix action on this that inserts 'your command'
And then run the profile, its not strictly speaking what the compliance feature is for but it should work.
Dave
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