Automation Center Documentation

File Monitor

From OpsWise Documentation Wiki

image:pdficon_small.gif Open as PDF

Contents

Overview

The File Monitor task allows you to monitor a specific remote machine for the creation, deletion, change, existence, or non-existence of one or more files at a specific location. The File Monitor task goes to SUCCESS the first time the conditions specified have been met. In order to run a File Monitor task, you need an Opswise agent (Windows, Linux, Unix, or z/OS) running on the machine where you are monitoring for the file. File Monitor tasks are used in conjunction with the File Trigger as shown in the following illustration.

image:file_monitor_flow.gif

Creating a New File Monitor Task

  1. From the Navigation Pane, select File Monitors.
  2. From the trigger wizard, select New. OpsWise Automation Center displays the File Monitor screen.
  3. Using the field descriptions provided below as a guide, complete the fields as needed.
  4. 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.
  5. If appropriate, repeat these steps for any additional tasks you want to add.

Shown below is a File Monitor task screen. Task run statistics appear after the first time this task has been launched.

image:ops_File Monitor task.gif

File Monitor Field Descriptions

The table below describes the fields, buttons, and tabs on the File Monitor 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/Instance 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.
Agent Optional. The name of the agent resource that describes the machine where the file being monitored for is located. The OpsWise agent and the file being monitored for must be on the same machine. 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. If you specify an agent cluster, the File Monitor uses the selection method specified in the agent cluster definition to determine which machine to monitor for the file. (You can monitor all agents in the cluster for the file using the Cluster Broadcast field -- see the description below.) If you specify an agent and an agent cluster, OpsWise Automation Center first tries to monitor 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.
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, the agent monitors all agents in the cluster. The first agent that satisfies the file monitor will also satisfy the trigger. If you specify an agent and an agent cluster, OpsWise Automation Center first tries to monitor the specific agent. If the agent is not available, the system reverts to the agent cluster. See Configuring Agent Clusters for more information.
Summary 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.
Start Time Task instance only; system-supplied. The time the task started.
Duration Task instance only; system-supplied. The amount of time the task took to run.
End Time Task instance only; system-supplied. The time the task completed.
Member of Groups User-defined. 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 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.
Monitor Type The type of file event being monitored for. Options:
  • Create - Wait for the creation of one or more files.
  • Delete - Wait for the deletion of one or more files.
  • Change - Monitor for a change in one or more files.
  • Exists - Check to see if one or more files already exists.
  • Missing - Check to see if one or more files is missing.
Monitor File(s) Specifies the location and file name of the file or files being monitored for. Variables supported. Wildcards supported.
Recursive If enabled, the monitor searches the specified directory and all subdirectories.
File Owner The user ID of owner of the file on the operating system. Specifying a file owner limits the search to files with that owner.
Maximum Files For searches that use wildcards, limits the number of files to be searched.
Stable (seconds) If Type = Change, a period of time, in seconds, during which the file has not changed.
By percentage (+/-) If Type = Change, the amount that the file size has changed, expressed as a percentage of the original file size. For example, enter 10 to monitor for a change in file size of 10 percent (larger or smaller).
By Size (+/-) If Type = Change, used in conjunction with the By scale field, specifies an actual change in file size. For example, to monitor for a change in file size of 10 MB, enter 10 in this field and select MB in the By scale field.
By scale If Type = Change, used in conjunction with the By Size field, specifies Bytes, KB (kilobytes), or MB (megabytes). For example, to monitor for a change in file size of 10 MB, enter 10 in the By Size field and select MB in this field.
To Size If Type = Change, used in conjunction with the To scale field, specifies an actual file size that you want to monitor for. For example, to monitor for a file size of 5 KB, enter 5 in this field and select KB in the To scale field.
To scale If Type = Change, used in conjunction with the To Size field, specifies an actual file size that you want to monitor for. For example, to monitor for a file size of 5 KB, enter 5 in the To Size field and select KB in this field.
Scan Text Optional. If Type = Create, Change or Exists, this field specifies a string that the monitor will search for in the file or files. Specifying a string means that only files containing the string constitute a match.
Scan Forward Optional. If Type = Change. If enabled, this field specifies that once the File Monitor has been satisfied, it should continue from where it left off. If it is scanning within a file, it should resume from the point in the file that it last scanned. If it is monitoring for files, it should resume monitoring for the next file.

If you are scanning a file that is being overwritten each time and you want to start from the beginning each time, you should disable Scan Forward.

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.
First Time Ran System-supplied. Displays after task has been run. The date and time this task first ran.
Lowest Instance Time System-supplied. Displays after task has been run. The shortest amount of time this task has taken to run.
Last Time Ran System-supplied. Displays after task has been run. The last date and time the task ran.
Average Instance Time System-supplied. Displays after task has been run. The average amount of time this task takes to run.
Number of Instances System-supplied. Displays after task has been run. The number of times this task has run.
Highest Instance Time System-supplied. Displays after task has been run. The longest amount of time this task has taken to run.
Last Instance Duration System-supplied. Displays 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.
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.
File Monitor Triggers tab Displays a list of all File Monitor 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.

Personal tools