10-28-2009 01:43 PM
Hey guys! Need help!
We acquired Ciscoworks LMS 3.1 and I can't seem to find the info I need to use it properly for scripting.
I need to mass configure over 150 2960 switches with a conditional statement, and don't know how or where and in what language to tell Ciscoworks to do that.
Basically I want to script something that would sound like this:
-Check each switch port, one at a time
-If the vlan is X, or Y or Z then
-Write all these interface commands
-Else write all those OTHER interface commands and check the next port!
Anyone can tell me how to do that!?
Thanx,
WANimal
10-28-2009 02:07 PM
This is best done with the baseline compliance feature of RME's Config Archive system. Checkout this whitepaper:
Then look at these case studies:
I think what you want is covered by scenario 4b.
However, since you have an ELSE, you will need to create two different templates to accomplish what you want due to bug CSCtb42198.
10-28-2009 02:15 PM
Thank you my friend (jclarke)...
This at least definitely gives me an idea WHERE to look.
WANimal
10-29-2009 09:01 AM
One problem I encounter in case 4B is that it goes as deep as the interface to check compliance...but I need to go in a VLAN submode to check for compliance, as the compliance must run against the VLAN.
How do I get it down one level to check the VLAN's value??? And can it check with an OR or an AND statement between statements???
As in:
-Check every interface in turn
-Check VLAN value for this interface
-If value is X OR Y or Z
-Then input THESE interface commands
-Else input THOSE interface commands
WANimal
10-29-2009 12:45 PM
Your template would need a prereq/parent:
Commandlet CheckVlan
IsPrereq: YES
Submode: interface [#.*Ethernet.*#]
Body:
+ switchport access vlan [#(X|Y|Z)#]
Commandlet: DeployCommands
Parent: CheckVlan
Body:
+ command1
+ command2
...
Then, your other template would look like:
Commandlet CheckVlan
IsPrereq: YES
Submode: interface [#.*Ethernet.*#]
Body:
+ switchport access vlan [#!(X|Y|Z)#]
Commandlet: DeployCommands
Parent: CheckVlan
Body:
+ command1
+ command2
...
10-29-2009 01:19 PM
Thank you SIR! Kindly!
You're a savior!
I should be able to fix the rest from hereon end!!!
WANimal
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