Scheduled tasks

Scheduled tasks are automated processing tasks that regularly run JavaScript-based scripts.

About scheduled tasks

After metric data is collected from hosts and stored in the database, the data undergoes several processing tasks for maintenance purposes. Platform Analytics automates the data processing by scheduling these processing tasks to run regularly. Each of these tasks calls a Javascript-based script.

You can modify these tasks, reschedule them, and create new scheduled tasks.

Scripts

Platform Analytics scheduled tasks call JavaScript-based scripts. These scripts work with data stored in the database for various maintenance tasks such as deleting old or duplicate records, or checking for problems with the collected data.

Predefined scheduled tasks

Platform Analytics includes several predefined scheduled tasks.

Data latency checker (DataLatencyChecking)

The data latency checker scheduled task checks the data latency in the data collected from the data loaders and data transformers. If the data latency is longer than the configured value or interval, the data latency checker sends an email notification.

By default, the data latency checker scheduled task runs every hour. If you want to modify the default configuration, edit ANALYTICS_TOP/conf/health_check_notify.properties and then restart the Platform Analytics server.

Daily Report (DailyReportETL)

Daily report builds jobmart data to JOBMART_DAY table and hardware data to RPT_HARDWARE_DAY table. By default, this task runs every day.

Cluster and Workload (ClusterandWorkloadETL)

Cluster and workload builds jobmart data to RPT_CLUSTER_CAPACITY_RAW table and hardware data to RPT_WORKLOAD_STATISTICS_RAW table. By default, this task runs every hour.

Hardware Jobmart (HardwareJobmartLicusageETL)

Hardware builds jobmart data to RPT_JOBMART_RAW table,hardware data to RPT_HARDWARE_RAW table and flexlm license usage data to RPT_FLEXLM_LICUSAGE_RAW table. By default, this task runs every hour.

(Vertica only)Data purger (PartitionMaintenanceGroup*)

The data purger scheduled tasks, which all have "PartitionMaintenanceGroup" in their names, control the data purger.

For more information, see Data purger.

(Vertica only) Duplicate record remover (PKViolationClean)

The duplicate record remover scheduler task checks the most recent data in the database (one to three days old) and deletes any duplicate records in the database (that is, those with a primary key violation). This scheduled task is necessary because the Vertica database does not automatically delete records with a primary key violation.

By default, the duplicate record remover scheduled task runs every 12 hours.

(Oracle only) Tablespace partition (RawTablePartition and ReportTablePartition)

The tablespace partition scheduled tasks maintain partitioned tablespaces by creating new tablespaces or deleting tablespaces that are out of date. The RawTablePartition scheduled task maintains raw tablespace partitions and runs at 4:00 a.m. every day by default, while the ReportTablePartition scheduled task maintains aggregated tablespace partitions runs at 5:00 a.m. every day.

(Oracle only) Tablespace monitor (TSMonitor)

The TSMonitor scheduled task notifies you if any tablespaces have a utilization that exceeds a specified threshold. If you do not increase the tablespace size (or the tablespace does not increase in size automatically), the scheduled task sends a notification every hour. This scheduled task is disabled by default.

This scheduled task has the following prerequisites:

  • To monitor the tablespaces, the Platform Analytics user on the Oracle database must have the appropriate privileges in the tablespaces (by selecting the privileges on the DBA_DATA_FILES and DBA_FREE_SPACE tables).

  • Email notification must be enabled to receive the scheduled task notifications. See the Email notification chapter for more details.

Scheduled task actions


Action

Platform Analytics Console

View a list of scheduled tasks.

You need to do this to perform any other action on the scheduled tasks.

In the navigation tree, click Scheduled Tasks.

Create a task in the list of scheduled tasks.

See Create, edit, or view a scheduled task for detailed information.

View or edit a task from the list of scheduled tasks.

See Create, edit, or view a scheduled task for detailed information.

Remove a task from the list of scheduled tasks.

In the main window, right-click the scheduled task and select Remove Scheduled Task.

Run a task manually from the list of scheduled tasks.

In the main window, right-click the scheduled task and select Run Now.


Create, edit, or view a scheduled task

Create, edit, or view a scheduled task.

You might edit a scheduled task for the following reasons:

  • Schedule a task that is currently unscheduled

  • Edit the next run time

  • Edit the run interval

  • Add or edit task parameters

  • Modify how information about the task is logged and where it is stored

  • Modify the JavaScript file and function called by the task

  1. In the navigation tree of the Platform Analytics Console, select Scheduled Tasks.
  2. Select the scheduled task to create, edit, or view.
    • To create a new scheduled task, right-click on the main window and select Add Scheduled Task.

    • To edit or view an existing scheduled task, right-click the scheduled task in the main window and select Edit Scheduled Task.

    The Scheduled Task window for the scheduled task displays.

    For an existing scheduled task, the following information is displayed in addition to the scheduled task parameters:

    • Last Run Time: The previous time that this scheduled task was run.

    • Last Run Status: The status of the last run of this scheduled task.

    • Last Checkpoint: The last time the data was checkpointed during the scheduled task. If the checkpoint and the scheduled task are completed, this is "DONE".

  3. Edit the scheduled task parameters that you want to change.
    CAUTION:

    Do not change the name of the scheduled task; otherwise, Platform Analytics may have problems with scheduling your renamed task.

    1. To change the script file for the task, specify the new script file in the Script File field.

      The script file must reside in the ANALYTICS_TOP directory. If it is in a subdirectory, include the file path of the subdirectory in the field.

      For example, if the new script file is new_script.js and resides in the ANALYTICS_TOP/bin directory, define the new script file as the following:

      /bin/new_script.js

    2. To change the function to run in the script for the task, specify the new script function in the Script Function field.

      The script can include other functions, but the other functions will run only if they are called by this specified script function.

    3. To change the log file for this task, specify the new log file in the Log File field.

      The location of the log directory is as follows:

      • UNIX: ANALYTICS_TOP/log

      • Windows: ANALYTICS_TOP\log

    4. To change the level of detail of information recorded in the log file, select the new log level in the Log Level field.

      All messages of this level or lower are recorded in the log file. In decreasing level of detail, the logging levels are DEBUG, VERBOSE, INFO, WARNING, and ERROR.

      For example, if you specify "INFO", the log file contains INFO, WARNING, and ERROR messages.

    5. To enable scheduling for this task, enable the Enable Scheduling check box.
    6. To change the next date and time that this task is scheduled to run, modify the fields in the Next Run Time box.
    7. To change the run interval of the scheduled task to a fixed interval, select the Run every: field and specify the interval.
    8. To change the run interval of the scheduled task to a calculated value, select the Call this function field specify the function in the script file to determine the run interval.

      The function must return a time stamp string in the following format:

      YYYY-MM-DD hh:mm:ss.xxxx

      This time stamp indicates the the next date and time in which this task is scheduled to run.

    9. To add optional parameters that Platform Analytics looks for in the script file, enter them into the Parameters field.

      This field does not exist in certain scheduled tasks.

  4. For the TSMonitor scheduled task, specify the details of the tablespaces you want to monitor.
    1. Specify the name of the data source in the Data Source field.

      The default name of the data source is ReportDB.

    2. Specify a comma-separated list of the tablespaces for TSMonitor to monitor in the Tablespaces field. Leave this field blank if you want TSMonitor to monitor all tablespaces in the Oracle database.

      For example, to monitor the TS_DATA_01, TS_DATA_02, and SYSTEM tablespaces,

      TS_DATA_01, TS_DATA_02, SYSTEM

    3. Specify a threshold for tablespace utilization, as a percentage or a decimal value between 0 and 1, in the Threshold field.

      If there is at least one monitored tablespace that exceeds this threshold, TSMonitor sends a notification every hour until the tablespaces no longer exceed the threshold.

      For example, to set a threshold of 90%, specify 0.9 or 90% in the Threshold field.

  5. To save your changes and close the window, click OK.