Adding global substitution parameters
This topic describes how to add global substitution parameters.
Global substitution parameters can be referenced in templates, rules, Configuration Profiled dynamic fields, and Configuration Search reports. Global substitution parameters are specified as name-value pairs. You can mark sensitive parameters (for example, passwords, community strings) as hidden by using the Hide Value field. The values assigned to parameters that are marked as hidden are not shown to the user when referenced in templates, rules, change scripts, and reports.
Global substitution parameters are referenced by using the following syntax:
${global.field}
where field is the global parameter name.
You can specify a default value for a global variable by using this syntax:
${global.field:default}
where the default is used if the global variable is not found in the database.
For example: snmp-server community ${global.snmpROCommunity} RO ${global.snmpROAcl}
This example substitutes the value for global parameters named snmpROCommunity and snmpROAcl into the snmp-server command.
The following five out-of-the-box global substitution parameters return information about the local server:
- ${global.localhostAddress}: Returns the local server's IP address.
- ${global.localhostName}: Returns the local server's host name.
- ${global.localhostFullName}: Returns the local server's fully-qualified domain name.
- ${global.localhostSubnet}: Returns the local server's subnet.
- ${global.localhostSubnetMask}: Returns the local server's subnet mask.
Starting with the local server's host name, TrueSight Network Automation attempts to find its associated IP address and fully-qualified domain name. Depending on how the local server is configured, TrueSight Network Automation looks up the name in a name server (DNS NIS) or in a local hosts table or file. Depending on where the name is found, there are occasions when the fully-qualified domain name cannot be determined; in this case, the unqualified host name is placed into localhostFullName. One such example is: in /etc/hosts, when the first name that appears for an IP address includes no domain name.
To add global substitution parameters
- Open the Add Global Substitution Parameter page by navigating to Admin > System Admin > Global Substitution Parameters > Add.
- Enter information in the following fields:
- Name: Enter a unique name, up to 255 characters, for the global substitution parameter.
- Value: Select value of parameter.
- Hide Value: (Optional) Specify if the global parameter value should not be shown when displaying components (for example, Templates, Rules) that reference the parameter.
- Click Save to save this global substitution parameter.