Greetings SolarWinds Guru's,
I have been looking for and trying to create a template for our OPS team that would allow them to add IP addresses to an object group on the Firewall. This is easy enough if there is only one IP address to add, but sometimes there are two and others possibly three. If I add multiple parameters/Variables NCM will not allow me to move forward if any are left blank. I know that I could write a simple Script and have the OPS team simply fill in the script under Configuration Management, but I was hoping to create something more elegant.
Is what I want to do even possible?
This is what my template looks like now:
/*
.CHANGE_TEMPLATE_DESCRIPTION
This template is for the addition of hosts to the AllowedIPs object group.
.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 @ObjectGroupName
This is the name of the object group. network CRS_Report-<TPA Code>
.PARAMETER_DESCRIPTION @ipaddress1
IP address of the first network-object host
.PARAMETER_LABEL @ipaddress2
IP address of the second network-object host
.PARAMETER_DESCRIPTION @ipaddress3
IP address of the third network-object host
*/
script BaseChangeTemplate(
NCM.Nodes @ContextNode,
string @ObjectGroupName,
string @ipaddress1,
string @ipaddress2,
string @ipaddress3
)
{
CLI
{
configure terminal
object-group network @ObjectGroupName
network-object host @ipaddress1
network-object host @ipaddress2
network-object host @ipaddress2
object-group network AllowedIPs
group-object @ObjectGroupName
}
}
Any help would be greatly appreciated.