1 of 1 people found this helpful
All of my experiments has shown that it is not possible to do logic within a change template or script. You can do extremely basic string manipulation (String AB = StringA + StringB). However if that functionality is absolutely required for the config change your are trying to push you could look into leveraging scripts on the device itself and used by NCM. I have done this several times and it while not straight forward or simple, it can fill some of the gaps in NCM.
If you are using Cisco devices you will want to look at their Embedded Event Manager and TCL scripting. I have had to use them in conjunction mainly because I don't know TCL very well. I would push an EEM script that will do the config change portion and then when I am ready to perform the desired change with logic I perform the logic with TCL and call the EEM script within the TCL script with the correct attributes. As I said not straight forward or simple, but it can be effective.
Another option would be run that script on the desired devices, run a sql query to examine the transfer logs and use those results to change a custom property. Then you just push you config based on the custom property value. i would probably use this method if I just needed to know if command 'x' returned result 'y'. The first way I mentioned would be more useful for ready the contents of the config and using those contents again (added new static routes for the site's backup connection, implementing a VRF and so on). Hope this helpedeven though it is likely not the news you were wanting to hear.