Linux/Unix Task
From OpsWise Documentation Wiki
Contents |
Before You Begin
The Linux/Unix agent task allows you to run a platform-specific application on a Linux/Unix machine. To run a Linux/Unix task, you must first complete the following tasks:
- Install an OpsWise Automation Center Linux/Unix agent on a Linux/Unix machine.
- Launch the agent. When the agent connects with the core processor, it automatically creates an agent resource definition in the database.
- Optionally, customize the agent heartbeat and log levels, as described in Linux/Unix Resource Field Definitions.
Creating a New Linux/Unix Task
- From the Navigation Pane, select Linux/Unix Tasks.
- From the trigger wizard, select New. OpsWise Automation Center displays the Linux/Unix task screen, shown below.
- Using the field descriptions provided below as a guide, complete the fields as needed.
- Click the Submit button to save the record and return to the menu, or, right-click on the title bar and select Save to save the record and remain on the current display.
- If appropriate, repeat these steps for any additional tasks you want to add.
Shown below is a sample Linux/Unix task screen. The task run statistics shown at the bottom appear after the first time this task has been launched.
Linux/Unix Task Field Descriptions
The table below describes the fields, buttons, and tabs on the Linux/Unix Agent task definition and task instance screens. Most fields appear on both screens; however they do not always appear at the same spot. In the latter case, the table provides a field description at the location found on the task definition screen. Some fields appear only on one of the screens. Field labels shown in bold appear only on the task instance screen and are labelled as such.
| Field Name | Description | |
|---|---|---|
| Task Name | Required. Name used within OpsWise Automation Center to identify this task. Up to 40 alphanumerics; variables supported. It is the user’s responsibility to develop a workable naming scheme for tasks. | |
| Invoked by | Task instance only; system-supplied. How the task instance was launched. Options:
Trigger: [Trigger Name] - The instance was launched by the named trigger. Workflow: [Workflow Name] - The instance was launched by the named workflow. Manually Launched - The instance was launched by a user. To identify the user who launched the instance: |
|
| Task | Task instance only; system-supplied. | |
| Execution User | Task instance only; system-supplied. | |
| Instance Reference Id | Task instance only; system-supplied. | |
| Credentials | Optional. The login credentials OpsWise Automation Center will use to access the remote machine. See Credentials. | |
| Credentials Variable | Optional. If enabled, the Credentials field (see above) converts from a reference field (where you browse and select a record) into a text field that allows you to enter a variable. Use the format: ${variable name}. The variable must be a supported type as described in Using Variables. | |
| Run as sudo | Optional. Run the command as Sudo (superuser do). | |
| Agent | Optional. The name of the Linux/Unix agent resource that describes the machine where the application will run. If you do not specify an agent, you must specify an agent cluster (see below). | |
| Agent Cluster | Optional. You can specify an agent cluster in addition to or in place of a specific agent. An agent cluster is a group of agents, one of which the system will choose to run this task. If you specify an agent and an agent cluster, OpsWise Automation Center first tries to run the task on the specific agent. If the agent is not available, the system reverts to the agent cluster. See Configuring Agent Clusters for more information. | |
| Agent Variable | Optional. If enabled, the Agent field (see above) converts from a reference field (where you browse and select a record) into a text field that allows you to enter a variable. Use the format: ${variable name}. The variable must be a supported type as described in Using Variables. | |
| Agent Cluster Variable | Optional. If enabled, the Agent Cluster field (see above) converts from a reference field (where you browse and select a record) into a text field that allows you to enter a variable. Use the format: ${variable name}. The variable must be a supported type as described in Using Variables. | |
| Hold on Start | Optional. If enabled, when the task is launched it appears in the Activity display with a status of Held. The task runs when the user releases it. . | |
| Cluster Broadcast | Optional. You can specify a Cluster Broadcast in addition to or in place of a specific agent and/or Agent Cluster. When you specify an agent cluster in the Cluster Broadcast field, OpsWise Automation Center runs the task on all the agents in the cluster. Each instance of the task running on its own agent becomes a separate task instance record in the database and displays separately in the Activity monitor. See Configuring Agent Clusters for more information about defining agent clusters. | |
| Summary | Optional. User-supplied description of this task. | |
| Status | Task instance only; system-supplied. See Task Status. | |
| Status Description | Task instance only; system-supplied. Provides additional information, if any, about the status of the task. | |
| Queued Time | Task instance only; system-supplied. The time the task was queued for processing. | |
| Process ID | Task instance only; system-supplied. The ID of the process that was launched. | |
| Start Time | Task instance only; system-supplied. The time the task started. | |
| CPU Time | Task instance only; system-supplied. The amount of CPU time the task took to run. | |
| End Time | Task instance only; system-supplied. The time the task completed. | |
| Duration | Task instance only; system-supplied. The amount of time the task took to run. | |
| Member of Groups | Optional. Allows you to select one or more Opswise groups that this task definition belongs to. Click on the lock icon to unlock the field and select groups. | |
| User-Estimated Duration | Optional. The estimated amount of time it should normally take to run this task. The value in this field is used by OpsWise Automation Center to calculate the User Estimated End Time when the task is launched. You can view this information by selecting the Task Instance record from the Activity screen. | |
| Command | Required. The command being executed on the remote machine. Variables supported. | |
| Parameters | Optional. Any arguments needed by the program to execute properly. Variables supported. | |
| Runtime Directory | Optional. The directory where the application should be executed from. Variables supported. | |
| Exit Code Processing | Required. Specifies how OpsWise Automation Center should determine whether the each step in the JCL failed or completed successfully. Options:
| |
| Output Type | Required if Exit Code Processing = Success Output Contains or Failure Output Contains. This field specifies the type of output. Options:
|
|
| Exit Codes | Required if Exit Code Processing = Success Exitcode Range or Failure Exit Code Range. This field specifies the range. Each step in the JCL must end with an exit code that falls within the specified range or the step goes to a Failed status. Format: Numeric. Use commas to list a series of exitcodes; use hyphens to specify a range. Example: 1,5, 22-30. | |
| Scan Output For | Required if Exit Code Processing = Success Output Contains or Failure Output Contains. This field specifies the text for which OpsWise Automation Center should scan the output file. | |
| Output File | Required if Output Type = File. This field specifies the path and file name of the file containing exit code processing data. | |
| Environment Variables: Name and Value | Optional. Allows you to enter environment variables needed by the program to run. Type in the name of the variable and its value, and click Add. The variable is listed in the space below. You can add as many variables as needed. To delete a variable, click the X button. | |
| Automatic Output Retrieval | Optional. Allows you to specify whether you want the system to automatically retrieve any output from the job and attach it to the task instance record. Options:
| |
| Output File | Required if Automatic Output Retrieval=File. This field specifies the path and filename containing the output that you want attached to the task instance. | |
| Starting Line | Optional. Allows you to instruct the system to fetch data beginning at the line indicated. | |
| Number of Lines | Optional. Allows you to limit the retrieved data to the number of lines specified. The default is 100. You can change the default by modifying the record Configuration > Properties > Retrieve Output Default Maximum Lines. | |
| Scan Output For | Optional. Instructs the system to scan the data for the text specified and retrieve only that. | |
| Late Start | Optional. If enabled, and if the task instance starts after the time specified in the Late Start Time field (see below), the task instance is flagged as late. To determine whether a task instance started late, open the task instance and locate the Started Late field; the field is checked if the instance started late. | |
| Late Start Type | Required if Late Start is enabled. Options are:
|
|
| Late Start Time (hh:mm) | Required if Start Type=Time. The time after which the task start time is considered late. Use hh:mm, 24-hour time. | |
| Late Finish | Optional. If enabled, and if the task instance finishes after the time or period specified, the task instance is flagged as late. You can specify a time or duration to determine a late finish (see Late Finish Type below). To determine whether a task instance finished late, open the task instance and locate the Finished Late field; the field is checked if the instance finished after the specified time or lasted longer than expected. | |
| Late Finish Type | Required if Late Finish is enabled. Use this field to specify whether you want to use time (see Late Finish Time below) or duration (see Late Finish Duration below) to determine whether the task instance finished late. | |
| Late Finish Time (hh:mm) | Required if Late Finish Type=Time. Use this to specify the time after which the task finish time is considered late. Use hh:mm, 24-hour time. | |
| Late Finish Duration | Required if Late Finish Type is Duration. Use this to specify the longest amount of time this task instance should take to run. You can specify any combination of days, hours, minutes, and seconds. | |
| User Estimated End Time | Task instance only; system-supplied. | |
| Shortest Estimated End Time | Task instance only; system-supplied. | |
| Average Estimated End Time | Task instance only; system-supplied. | |
| Longest Estimated End Time | Task instance only; system-supplied. | |
| Early Finish | Optional. If enabled, and if the task instance finishes before the time or period specified, the task instance is flagged as early. You can specify a time or duration to determine an early finish (see Early Finish Type below). To determine whether a task instance finished early, open the task instance and locate the Finished Early field; the field is checked if the instance finished before the specified time or did not last as long as expected. | |
| Early Finish Type | Required if Early Finish is enabled. Use this field to specify whether you want to use time (see Early Finish Time below) or duration (see Early Finish Duration below) to determine whether the task instance finished early. | |
| Finished Early | Task instance only; system-supplied. This field is flagged if the task finished earlier than specified in the Early Finish fields. | |
| Early Finish Time (hh:mm) | Required if Early Finish Type is Time. Use this to specify the time before which the task finish time is considered early. Use hh:mm, 24-hour time. | |
| Early Finish Duration | Required if Early Finish Type is Duration. Use this to specify the shortest amount of time this task instance should take to run. If the task finishes before the amount of time specified, it is flagged as early. You can specify any combination of days, hours, minutes, and seconds. | |
| Task Priority | Task instance only; system-supplied. | |
| Maximum Retries | Optional. Allows you to specify the maximum number of times the system should retry running the task if technical problems are keeping it from running. | |
| First Time Ran | System-supplied. Displays on task definition record after task has been run. The date and time this task first ran. | |
| Lowest Instance Time | System-supplied. Displays on task definition record after task has been run. The shortest amount of time this task has taken to run. | |
| Last Time Ran | System-supplied. Displays on task definition record after task has been run. The last date and time the task ran. | |
| Average Instance Time | System-supplied. Displays on task definition record after task has been run. The average amount of time this task takes to run. | |
| Number of Instances | System-supplied. Displays on task definition record after task has been run. The number of times this task has run. | |
| Highest Instance Time | System-supplied. Displays on task definition record after task has been run. The longest amount of time this task has taken to run. | |
| Last Instance Duration | System-supplied. Displays on task definition record after task has been run. The amount of time the task took to run the last time it ran. | |
| Submit button | Submits the new record to the database. | |
| Update button | Saves updates to the record. | |
| Launch Task button | Manually launches the task. | |
| Delete button | Deletes the current record. | |
| Output tab | Displays output generated from the process. | |
| Task Virtual Resources tab | Allows you to create virtual resource definitions for controlling access to resources by multiple tasks. See Creating Virtual Resources. | |
| Variables tab | Displays all variables associated with this task. | |
| Actions tab | Allows you to specify actions that the system will take automatically based on events that occur during the execution of this task. Events supported are task instance status, exit codes, late start, late finish, and early finish. Actions include:
|
|
| Task Instances tab | System-supplied. Displays a list of all instances generated by this task. | |
| Triggers tab | Displays a list of all triggers that have been defined to launch this task. Also allows you to add new triggers. For instructions, see Triggers. | |
| Notes tab | Displays all notes associated with this task. See Runbook Notes. | |
Specifying When a Task Runs
You can run the task as part of a workflow, specify triggers that run the task automatically based on times or events, or run the task manually.
Monitoring Task Execution
You can monitor all system activity from the Activity screen and can view activity history from the Activity History screen.
