Watch Command Step in Step Configuration Wizard

A Watch step monitors a device session for specified messages or traps (for SNMP sessions). When a message or a trap is received that matches a specified regular expression, an user event is triggered and a configured procedure is executed. If the procedure to be executed has arguments, these can be assigned a number of predefined portions of the received message.

To add a Watch command step using the GUI scripting support:

  1. While in the Script Steps pane, add a step by choosing the Actions > Add step... command.
  2. Select a Watch command, click the button to validate the selection, and specify the following parameters:
    • Run Type: A Watch step can be executed sequentially (Sequential) or with other steps (Parallel). When defining a step as parallel, a step Id needs defined, such as to be able to access the step using a Join command step.
    • Delay: A delay specifying by how much step start is delayed. A delay value is automatically set when the step is added using the Capture functionality.
    • Timeout: This parameter is not available for a Watch step.
    • Ignore step: When this option is selected, the step is skipped at execution time. Selecting this option is equivalent to right-clicking a step in the Script Steps table and choosing the Exclude command from the context menu that appears.
    • Description: An optional step description can be associated with a step.
  3. Define the Conditional Execution settings as explained below.
  4. Conditional Execution settings enable you to define the system conditions a script step execution is monitored for. When such a predefined condition occurs – a step error or a step timeout – a user-defined procedure is executed and an additional action is performed. For example, on encountering a step error, you could enforce the execution of a cleanup procedure and then terminate the script.

    To monitor the step for a predefined Timeout or Error condition, select the corresponding condition, then define the associated procedure – local or shared (external) – by clicking the control of the Procedure field and selecting a procedure from the the drop-down pane that appears.

    For the selected procedure you can view its defined arguments by clicking the control of the Input Arguments field, which displays a cascading table-format pane containing the argument list. To specify the actual runtime argument(s) enter the desired values in the Current Value field(s).

    Configure an additional action by clicking into additional actions column and selecting either of the following options:

    • Continue: After performing the specified procedure, the script execution continues.
    • Exit Test: After performing the specified procedure, the script execution is terminated.

    Click Next.

    Whenever the step execution is monitored for predefined or user-defined events, an icon is displayed in the step's corresponding Events selected column entry. For information on turning on the displaying of the Events selected column refer to Customizing the Script Steps Table Layout.

  5. Define the command evaluation parameters as follows:
    • Session: The device session that is monitored for a user-defined event.
    • Watch For: A period of time after which monitoring is suspended.
    • Watch: If the Watch step was defined as a parallel executing step, selecting the Always option monitors the session for the entire script duration.
    • Click Next.

  6. Depending on the session type, the Match Options page enables you to monitor the command output for specified messages or traps.
  7. When a message or a trap is received that matches a specified regular expression, an user event (local or global) is triggered and a configured (local to the script or shared) procedure is executed. If the procedure to be executed has arguments, these can be assigned a number of predefined portions of the received message.

    The main difference between local and global user events is that local events are defined and used only within a single script step, whereas global events can be accessed from all script steps. For information on defining global user events, refer to Defining User Events.

    Click the button and define an expression to match, associated with the performing of an action and the execution of a procedure.

    • For sessions event processing are as follows:
    • Specify a regular expression (Search For column).

      Select a local event or an existing global event (Event column). Alternatively, define a new global event by clicking the field's <add user event entry>, which brings up the User Events Catalog. See Defining User Events.

      If a local event is selected, you can configure an executed procedure, local or shared (Procedure to Run column). If a global event is selected, the procedure that is associated with that event automatically becomes selected in the Procedure to Run column.

      Eventually, if the associated procedure has arguments, click the button to assign one of the following entities to a procedure parameter:

      • value of message: The entire message string is assigned to the parameter.
      • search result: The matched expression is assigned to the parameter.
      • constant value: A constant user-defined value is assigned to the parameter.

      IMPORTANT:

      Special attention is required when configuring user event processing such as to avoid inconsistent device output monitoring:

      • Assuming, for example, that we have an Execute command that generates continuous, multi-portion output, and that the command output is monitored for multiple expressions triggering multiple events, say E1 and E2.

      • Given the continuous nature of the output, it could happen that at one moment an output portion matches one of the specified expressions and that the corresponding event, say E1, is triggered by this occurrence.

      • Now, assuming that E1 is configured with the "Proceed with Next Step" additional action, it could happen that, while E1 is being processed, and before the Device Terminator is sent, another event, E2, is triggered. This would result in both events, E1 and E2, being processed, irrespective of E1's configured "Proceed with Next Step" option.

  8. Verify the step summary information and revert to a previous configuration step if needed. Click Finish.