Is there a handy way to debug NCM configuration change templates? I have a script that validates and runs without error, but doesn't produce the expected output. I'd really like something that would let me evaluate the script step by step so I can identify the problem. Any suggestions?
Here's the script. The output has the "configure terminal" line and then nothing else. No error or warning is reported.
=====================
Script EnableIPSLAForVoip (
NCM.Nodes @ContextNode,
int @OperationNumber,
string[] @DestIPAddrs )
{
string @sourceIP = ''
// Enter configuration mode
CLI
{
configure terminal
}
// Determine the Portchannel10.10 IP to use as source.
foreach (@interface in @ContextNode.Interfaces)
if (@interface.InterfaceDescription Contains 'Port-channel10.10') {
foreach (@ip in @interface.IpAddresses) {
if (@ip endsWith '254') {
// nothing
} else {
@sourceIP = @ip.IPAddress
}
}
}
}
// Enter the commands for each IP address in the list provided
foreach(@DestIPAddr in @DestIPAddrs)
{
CLI
{
ip sla @OperationNumber
udp-jitter @DestIPAddr 17000 source-ip @sourceIP
tos 184
exit
ip sla schedule @OperationNumber life forever start-time now
}
// Increment the operation number for the next operation
@OperationNumber++
}
// Exit configuration mode
CLI
{
end
}
}