When defining interface for config change template the information that is listed in "Select Interface List" is non-helpful.
This is what it looks like:
---
Name:Fa0/1 Description:FastEthernet0/1 VlanId:none VlanType:none PortStatus:none
Name:Fa0/2 .... and so on.
---
When in fact Fa0/1 does have a custom description, a VlanId, and the port status is active (just ask my NPM - it knows!).
So why can't the NCM talk to NPM and give me some real-life info in the list?
Is there something in my script that is missing?
Well, here it is:
/*
.CHANGE_TEMPLATE_DESCRIPTION
This change template configures ports on Cisco IOS devices.
.CHANGE_TEMPLATE_TAGS
Cisco, IOS,
.PLATFORM_DESCRIPTION
Cisco IOS
.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 @TargetPorts
Velg én port:
.PARAMETER_DESCRIPTION @TargetPorts
NB! Dersom flere porter merkes vil disse..
.PARAMETER_LABEL @NewStatus
Skriv "shut" eller "no shut":
.PARAMETER_DESCRIPTION @NewStatus
Skriv "shut" for .. stenge. Skriv "no shut" etc..
*/
script ConfigureInterfaceOnCiscoIOS (
NCM.Nodes @ContextNode,
NCM.Interfaces[] @TargetPorts,
string @NewStatus
)
{
// Enter configuration mode
CLI
{
configure terminal
}
// Loop through selected ports
foreach (@portItem in @TargetPorts)
{
CLI
{
interface @portItem.InterfaceDescription
}
// Loop kommandoer
{
CLI
{
@NewStatus
}
}
}
// Exit configuration mode
CLI
{
exit
}
}