Administer > Policies > Scheduled Task Policies > Scheduled Task Policy User Interface > Configuring Tasks in Scheduled Task Policies

Configuring Tasks in Scheduled Task Policies

In the Task page, you specify a command or script that you want to run on the Operations Connector system.

To access

In the Operations Connector user interface, click Create in the toolbar, then click Event > Scheduled Task Scheduled Task. The scheduled task policy editor opens. 

Alternatively, double-click an existing scheduled task policy to edit it.

Click Task.

Tasks

How to configure tasks

In Task type, select one of the following options:

  • Command

    By default, the command runs under the same account as the agent is running, which is Local System or root by default.

    • Command: Type the complete path and extension of the command that you want to run on the Operations Connector system (for example, %OvDataDir%\bin\instrumentation\cleanup.exe). The file that you specify should exist on the system.

    • Username: Type the user name under which the command should be run. The user must exist and have permission to run the command on the system. If you specify a non-existent user, the command fails to run.

    • Password: Specify a password for the user. If the password changes, the policy must be updated and reactivated.

  • VB Script

    Type the VB script in the window. Alternatively, click Load VB script file from Client to load an existing script.

    Use the policy method Rule.Status to specify whether the task is successful. For example, to specify that the task has failed (and trigger a failure message), use Rule.Status=False.

    Operations Agent uses a generic Microsoft scripting engine to run VBScript scripts. You can therefore use standard VBScript objects (for example, the FileSystemObject object) in your scripts. Objects that are specific to wscript or cscript (for example, the WScript object) are not supported.

  • Perl Script

    Type the Perl script in the window. Alternatively, click Load VB script file from client to load an existing script.

    Use the policy method $Rule->Status to specify whether the task is successful. For example, to specify that the task has failed (and trigger a failure message), use $Rule.Status(False).

  • The agent runs as a service that has no standard input, standard output, or standard error. Therefore, the predefined file handles STDIN, STDOUT, and STDERR are not available for Perl scripts in scheduled task policies. It is also not possible to open file handles that use command pipes or capture the standard output from commands within backticks (`).

Related tasks

UI Descriptions

Policy Task Page

UI Element

Description

Load <perl / VB Script> from Client Opens a file selection dialog box for you to select the VB or Perl script to load into the policy.

Task Type

Type of task:

  • Command

  • VB Script

  • Perl Script

Command

Complete path and extension of the command that you want to run (for example, %OvDataDir%\bin\instrumentation\cleanup.exe). The file that you specify should exist on the system.

By default, the command runs under the same account as the agent is running, which is Local System or root by default.

Username User name under which the command should be run. The user must exist and have permission to run the command on the system. If you specify a non-existent user, the command fails to run.
Password Password for the user. If the password changes, the policy must be updated and reactivated.
VB Script

Code that defines the VB script. Instead of typing the script into the field, you can upload an existing script.

Use the policy method Rule.Status to specify whether the task is successful. For example, to specify that the task has failed (and trigger a failure event), use Rule.Status=False.

Operations Agent uses a generic Microsoft scripting engine to run VBScript scripts. You can therefore use standard VBScript objects (for example, the FileSystemObject object) in your scripts. Objects that are specific to wscript or cscript (for example, the WScript object) are not supported.

Perl Script

Code that defines the Perl script. Instead of typing the script into the field, you can upload an existing script.

Use the policy method $Rule->Status to specify whether the task is successful. For example, to specify that the task has failed (and trigger a failure message), use $Rule->Status(False).

The agent runs as a service that has no standard input, standard output, or standard error. Therefore, the predefined file handles STDIN, STDOUT, and STDERR are not available for Perl scripts in scheduled task policies. It is also not possible to open file handles that use command pipes or capture the standard output from commands within backticks (`).