Adding parameters

Parameters are used as general placeholders for values that are used on a frequent basis. Examples of parameters are DATABASE_NAME, DIRECTORY, HOSTNAME, URL and so on.

Before you begin

You can use runbook parameters in the following scenarios:
  • Parameters can be used as variables that get substituted by a value in the text of a runbook step, for example:
    STEP 2
    In this step you determine the longest running process of system $SYSTEM 
    
  • As input to a command defined in a runbook, for example:
    STEP 5
    Now issue the command: cd $DIRECTORY 
    
  • Parameters of an automation can be filled with the value of a parameter defined for the runbook.
  • Automations of type Script have a system parameter target which defines the target system where the script is run.
  • Automations of type Script have a system parameter user that specifies the UNIX username which is used to run the script on the target system. This parameter can be mapped automatically to the user who is currently logged in to Runbook Automation. For more information, see Adding automations.

About this task

Operators enter values such as username, password, hostname, database name or URL on a frequent basis. If you have to deal with many different computer systems, you must remember numerous user names, passwords, hostnames or database names. In order to avoid typos or having to remember values, you can define parameters. For example, you can define a parameter DATABASE_NAME and either provide a default value or enter the value when you run the runbook. Default values are the best fit if you do not want operators to remember and enter the value.

Parameters are local to the runbook. They are not available for other runbooks.

Parameters are used within runbooks and for automations. Within runbooks, you can use parameters either standalone, for example URL, or within a command, for example connect to HOSTNAME.

Parameters must be filled with values when executing a runbook. This can be done in the following ways:
  • When a runbook is launched by clicking the execute button from the Runbook Automation UI, an operator must first enter the parameter values. The operator is prompted with the name and description of all parameters defined for the runbook, as well as an optional default value.
  • When a runbook is launched from an event, a Trigger defines which values of the event data are mapped to which parameter of the runbook. Values that are entered in this way cannot be changed.
Runbook parameter values can be changed during the execution of a runbook. In any step of a runbook, you can select the parameter section of the runbook in the sidebar. You might need to expand the section first, if it is collapsed. The parameter can then be changed to a new value. To apply the new value click Update (the Update button is only displayed if the parameter value has been changed). Steps of the runbook that are not yet executed will reflect the new value.

Runbook parameters can be used to define parameter values for automations within the same runbook. Parameter values for automations can be filled using the result of a previously executed automation.

In this way, the parameter Automation output of a previous automation Find large file systems is an automatic parameter available for automations in the current step. It is possible to use the output of any automation that ran before in this runbook.

Procedure

  1. Create a parameter. Click Add Parameter Add parameter .A dialog box opens where you can enter the parameter name, the description, and the default value. If you select Optional you can start the runbook execution without defining a value, and set the parameter value during runbook execution. This setting is useful if the parameter value is not available at the beginning of the execution, but during execution.

    When you enter the runbook parameter name you can use alphanumeric characters, characters from national languages, and some special characters. But do not use the special characters ampersand (&), backslash (\), space ( ), greater than (>) or less than (<) when you define runbook parameter names.

    As a result, a parameter of the runbook is created and can be used as a variable in the text of a step, as a variable value of a command, or as input of an automation added to a runbook step. For more information about how to use parameters, see Runbook elements and editing actions.

  2. Edit a parameter. Click Edit edit next to the parameter that you want to edit.
  3. To edit a parameter used by an automation, click Edit edit for the automation you have added to a runbook step.