Hi All,
I created a Config Change Template a couple of years back and was working up until recently. The script was intended to have a user select a switch from a dropdown menu then select a port on that switch when they go to DEFINE VARIABLES & RUN. The user is still able to see the dropdown with all the switches and select a switch but regardless of which switch they select they get no interfaces when they click on the SELECT INTERFACES LIST button. All they get is "No Entities" listed under the switch they selected. I tried this with my account and I get the same results they do even though I have higher rights than they do. I can also see the interfaces when I go to Settings... Manage Nodes... Select the switch... then click on the List Resources link which tells me I have the proper rights to view the interfaces. For some reason they are just not populating when we click on the SELECT INTERFACES LIST button. I went through every single Cisco switch in our environment and get "No Entities" listed under each of them. Has anyone experienced this in their environment?
Here is the code for the template...
/*
.CHANGE_TEMPLATE_DESCRIPTION
This template by XXXXXXXX is used to shut then no shut ports on Cisco switches using Solarwinds Config Change Templates.
.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
Select Port(s)
.PARAMETER_DESCRIPTION @TargetPorts
Select the port to shut then no shut.
*/
script ShutNoShutPorts (
NCM.Nodes @ContextNode,
NCM.Interfaces[] @TargetPorts
)
{
// DEFINE THE PIPE SYMBOL FOR LATER USE AS THE PIPE SYMBOL ADDED DIRECTLY IN THE SCRIPT WON'T WORK
string @PipeSymbol='|'
// DEFINE 2 PAUSES. ONE FOR 2 SECONDS AND ONE FOR 20 SECONDS TO ALLOW FOR THE SCRIPT TIME TO DO IT'S THING.
string @PausePlease2='${Delay:2}'
string @PausePlease20='${Delay:20}'
// Enter configuration mode
CLI
{
configure terminal
}
// Loop through selected ports
foreach (@portItem in @TargetPorts)
{
CLI
{
interface @portItem.InterfaceDescription
shut
@PausePlease2
no shut
end
@PausePlease20
!
!
sh ip int brief @PipeSymbol incl @portItem.InterfaceDescription
}
}
}