4 Replies Latest reply on Oct 3, 2012 5:38 AM by cvachovecj

    How many people use Configuration Change Templates?


      I've tried to use configuration change templates, but find the lack of error logging makes this feature unusable except for the most simple scripts.  An example is I need to change a DHCP helper in every router.  How do I make sure this change was successful on every router?  Today, you must look the output of every router run in CCT, or you need to create a compliance policy that looks for your change. 


      What I've proposed in the past is to use standard "Expect" scripting construct that makes the change then waits for (or expects) some feedback to ensure the command worked (or capture the failure message) and end with a errorlevel so you know something is the script didn't execute as "expected".


      How many people actually use this feature?  I don't see alot of scripts posted to Thwack, so I don't think its overly used.

        • Re: How many people use Configuration Change Templates?

          I feel your pain.  I started trying to create a template today and I'm having a hard time trying to figure out how to do something that should be simple.  I wish there was more detailed documentation for the language.  I have no problem with SW creating their own scripting language for NCM but they really need to provide more documentation that a section in the admin guide.  For example:


          "Manipulating Strings

          You can use the functions substring, strlength, indexof, setoctet, getoctet to manipulate strings within your config change template scripts."


          Ok, so I can use those functions to manipulate a string but how do I use them?  In the example it provides a way to use setoctet.  It would be nice if we had documentation that showed each function, the parameters it takes, and how to use it. 


          In my example, I want to enter one command for a device that's running IOS 12 and another command for IOS 15.

            • Re: How many people use Configuration Change Templates?

              I've just written my first CCT, but it was difficult.

              Only way I was able to figure some things out was to look at other templates.  Not sure how the authors figured it out...

              Lack of a NOT operator was a problem - I have several empty if statements, with code in the else section because I wanted to do something on an interface that did not have a particular CDP neighbour.

              Hopefully, the functionality will expand

              • Re: How many people use Configuration Change Templates?

                I totally agree on better docs.  You almost have to try stuff and see what happens.


                Here's a sample of the HP Procurve script I use to get them into compliance.

                Note: I do a "write memory" as a separate CCT after I'm sure everything still works.




                        Update HP ProCurve 2510 switch configuration.


                        HP ProCurve 2510 Models j9019, j9020, J9279, J9280

                .PARAMETER_LABEL @ContextNode

                        NCM Node

                .PARAMETER_DESCRIPTION @ContextNode

                        The node the template will operate on.  All templates require this by default. The target node is selected during the first part of the wizard so it will not be available for selection when defining values of variables.


                .PARAMETER_LABEL @UTCDate

                        Zulu Date (UTC).


                        Enter the date at Zulu (UTC) in form MM/DD/YYYY.


                .PARAMETER_LABEL @UTCTime

                        Zulu Time (UTC).


                        Enter the time at Zulu (UTC) in form HH:MM  (24-hour format).




                script ProcurveChangeTemplate(  

                                             NCM.Nodes @ContextNode,

                                             string @UTCDate,

                                             string @UTCTime )


                If (@ContextNode.MachineType startsWith 'ProCurve Switch 25')

                  //This sets all the base configuration after running the initial configuration wizard.



                    config t

                    clock set @UTCDate

                    clock set @UTCTime

                    no banner motd

                ... other commands



                  //Allow auto loading of firmware during booting.  Load latest release on tftp server, and replace version with xx.

                  If (@ContextNode.SysDescr contains 'J9019')



                      auto-tftp 10.x.x.x "/procurve/Q_11_xx.swi"



                  If (@ContextNode.SysDescr contains 'j9020')



                      ... another command


                  //Exit configuration mode







                • Re: How many people use Configuration Change Templates?

                  I agree there is space for improvement for the CCT language, examples etc.

                  Specifically for the string manipulation functions (new in 7.1), you may want to check Better support for ACL manipulation in NCM.

                  For general CCT introduction, there is another blog post: More Automation in NCM: Usage of Variables and Custom Properties in Command Scripts and Config Change Templates.