Quantcast
Channel: THWACK: Message List - Network Configuration Manager
Viewing all articles
Browse latest Browse all 8827

NCM config change template for logging source-interface

$
0
0

I am trying to create a change template that will look at each interface on a node and capture the IP. I then want to take that IP and apply it to a logging source-interface command only if the interface type is a Loopback. I have the following script to try and do this, but i don't have the scripting experience to know what I am missing.

/*
.CHANGE_TEMPLATE_DESCRIPTION
This change template is used to set the logging source-interface to the loopback interface if there is one.
.CHANGE_TEMPLATE_TAGGS
Logging
.PLATFORM_DESCRIPTION
Cisco IOS

.PARAMETER_LABEL @ContextNode
NCM Node
.PARAMETER_DESCRIPTION @ContextNode
The node the template will operate on.

*/

script LoggingSourceTemplate(NCM.Nodes @ContextNode)


//Loop through selected nodes
{

foreach (@interfaceItem in @ContextNode.Interfaces)
{

foreach(@ip in @interfaceItem.IpAddresses)

{

if (@interfaceItem.InterfaceType == 'Loopback')

{

CLI

{

logging source-interface @ip

}

}

}

}

}


{


Viewing all articles
Browse latest Browse all 8827

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>