Add NSH Script - Parameters
The Parameters panel lets you define parameters that are replaced with server property values when a script runs. Using this panel, you can add flags to parameters, you can specify whether the flag is required at runtime, and, if necessary, require a value to be provided for the flag. In addition, you can define a default value for a flag, make the default value editable when the script is run, and require a value to be entered for the flag at runtime.
When you deploy a Network Shell script, TrueSight Server Automation automatically generates a master script that controls the script's deployment and execution. The system uses the parameters you define here to generate values in the master script.
If you are running a script one time against multiple hosts (as defined using the Add-NSH-Script-Script-Options panel), you must pass the %h or %f macro as a parameter when you execute the script. The %h macro is replaced by a space-delimited list of host names. The %f macro is replaced by a file containing a list of host names.
To add a parameter, click Add Parameter . To modify an existing parameter, select it in the Script Parameters list and then clicking Update Parameter
. Either of these actions displays the Add parameter dialog box, which has the following options:
Name | Name of the parameter. |
Description | Optional descriptive text. |
Flag | Enter a flag if the parameter requires one. Or, you might enter a flag, such as -b, that requires a build number for the script to execute. In this case, check the Accepts value option to ensure that a value is specified for the flag. The command line equivalent would be: |
Parameter flag required at runtime | Check if the flag is used when the Network Shell Script Job runs. If you do not check this option, the person who runs the Network Shell Script Job can choose whether the job should use the flag. By default this option is not checked. |
Accepts value | Check if the flag can accept a value. |
Default value | Enter a value. |
Editable | Check if the value can be edited when you run the script. |
To reposition a parameter within the list, select the parameter and click the up or down arrow.
To remove a parameter, select the parameter and click Delete .