I'm trying to run through my node IP addresses, find if a specific subnet is configured, and then set the syslog source-address. If the specific subnet doesn't exist on the equipment, it doesn't set that source-address. Am I doing this correctly? I've tried wrapping the CLI statements in their own curly brackets as well but it doesn't work.
script BaseChangeTemplate(NCM.Nodes @ContextNode)
{
foreach (@interfaceItem in @ContextNode.Interfaces)
{
foreach(@ip in @interfaceItem.IpAddresses)
{
if (@ip.IPAddress contains '10.0.9')
CLI
{
edit
set syslog host corp_syslog any info
set syslog host corp_syslog source-address @ip.IPAddress
}
else
CLI
{
edit
set syslog host corp_syslog any info
}
}
}
}