Updated on 2024-06-28 GMT+08:00

Scheduled O&M

The Scheduled O&M page displays the execution records of all scheduled tasks. You can create and manage scheduled tasks on this page. After scheduled tasks are created, operations (such as script execution and file/scenario/job management) are performed at a specified time or periodically. You can create up to 100 scheduled tasks.

Creating a Task

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane, choose Automation (Retiring). The Automation page is displayed.
  3. In the navigation pane, choose Scheduled O&M and click Create Scheduled Task in the upper right corner to create a task.
  4. Set parameters by referring to Table 1.

    Figure 1 Basic information for creating a scheduled task
    Table 1 Parameters for creating a task

    Parameter

    Description

    Task Name

    User-defined task name.

    Enter up to 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. By default, Auto is selected, which means that the system automatically generates a task name.

  5. Set parameters by referring to Table 2.

    Figure 2 Creating a scheduled task
    Table 2 Parameters for creating a scheduled task

    Parameter

    Description

    Time Zone

    Time zone of the scheduled task. You can select a desired time zone from the drop-down list.

    Execution Policy

    Execution policy of a scheduled task. Options:

    • One-time: The task is performed once at a specified time.
    • Periodic: The task is executed regularly based on the preset period.
    • Periodic (Cron): The task is performed based on the configured cron expression.

    Execution Time

    Time when a scheduled task is executed.

    Execution Interval

    This parameter is mandatory only when Execution Policy is set to Periodic.

    • Daily: every day in the period.
    • Weekly: Select one or more days from a week. By default, all days in a week are selected.

    Execution Rule

    This parameter is mandatory only when Execution Policy is set to Periodic (Cron).

    The task is performed based on the configured cron expression. Currently, the execution time can only start from minute 0 (ascending order) and the minimum interval is 30 minutes. For details about the rules and configuration methods, click View Details on the console.

  6. Set notifications by referring to Table 3.

    Figure 3 Notification settings
    Table 3 Notification parameters

    Parameter

    Description

    Successful Execution

    When a task is successfully executed, a notification is sent to related personnel. By default, this function is disabled.

    • Send To: Select one or more recipients from the drop-down list.
    • You can also click Create Topic for notification. Specifically, create a topic and add subscriptions to the topic for notification.

    Failed Execution

    When a task fails to be executed, a notification is sent to related personnel. By default, this function is disabled.

    • Send To: Select one or more recipients from the drop-down list.
    • You can also click Create Topic for notification. Specifically, create a topic and add subscriptions to the topic for notification.

    Notifications can be sent by email or SMS.

  7. Set a task. The task type can be Scripts, Packages, Scenarios, and Jobs.

    • Set a script execution task.
      1. Set Task Type to Scripts.
      2. Enter the script name, script parameters, timeout duration, and execution account. The Script Name drop-down list displays only released scripts. Script version, which is automatically obtained based on the selected script name.
        If Sensitive next to Script Parameters is selected, the content you enter will not be explicitly displayed in the Script Parameters text box.
        Figure 4 Setting a script execution task
      3. Select target instances. Specifically, click Add. The instance selection page is displayed. For Instance Type, the default value is ECS. For Method, the default value is Specific. For details about the methods, see Table 4.
        Table 4 Selection method description

        Selection Method

        Description

        Specific

        Enter search criteria and select instances from the instance list. By default, instances are searched by name.

        By filter

        • Enter filter attributes and values to search for instances.
        • If there are multiple filter criteria, the search is performed based on the AND relationship.
        • This method also takes effect for instances added later.

        By tag

        • Set tag keys and values, and specify one or more tags to select instances.
        • If there are multiple tags, the search is performed based on the AND relationship.
        • This method also takes effect for instances added later.

        From CMDB

        Enter search criteria or keywords and select instances from CMDB. There are two types of nodes:

        • Static: Select an ECS under a specified CMDB application.
        • Dynamic: Select a node in the CMDB application to dynamically obtain ECSs under the node. This method also takes effect for instances added later.
    • Set a package management task.
      1. Set Task Type to Packages.
      2. Enter the package name, version, type, timeout duration, storage path, and execution account. Only released packages are displayed in the drop-down list. Versions are automatically displayed based on the packages you select.
        Figure 5 Setting a package management task
      3. Select target instances. Specifically, click Add. The instance selection page is displayed. For Instance Type, the default value is ECS. For Method, the default value is Specific. For details about the methods, see Table 4.
    • Set a scenario task.
      1. Set Task Type to Scenarios.
      2. Select a scenario from the drop-down list. For details about operations in different scenarios, see Scenarios.
        Figure 6 Setting a scenario task
    • Set a job management task.
      1. Set Task Type to Jobs.
      2. Select a job name and an execution plan from the drop-down lists.
        Figure 7 Setting a job management task

  8. If needed, expand More to set the review configuration and execution policy by referring to Table 5.

    Table 5 More settings

    Category

    Parameter

    Description

    Review

    Review

    Specifies whether to enable manual review. By default, the setting cannot be changed. To change the review settings for default scenarios, go to the Tool Market to set atomic cards; for job execution plans, go to the Jobs page; for packages, go to the Packages page; for scripts, go to the Scripts page.

    Reviewer

    After manual review is enabled, you need to select a reviewer.

    Alternatively, create a topic and add a subscription on the SMN console to notify a reviewer.

    Execution Policy

    Batch Release

    Specifies whether to enable batch release. By default, this function is disabled.

    Instances for Each Batch

    Number of instances on which tasks can be executed at the same time.

    Interval

    Interval for executing each batch of tasks.

  9. Click Submit to create a scheduled task.

More Operations

After a task is created or executed, you can view Task Name, Task Type, Execution Policy, Latest Execution, Updated By, Updated, Start/Stop Task, and Operation on the task list page. You can also perform the operations listed in Table 6.

Table 6 Related operations

Operation

Description

Starting or stopping a task

Click the button in the Start/Stop Task column to start or stop a task.

Modifying a task

Click Modify in the Operation column to modify a task.

You can modify a task only when the task is closed.

Viewing execution records

Click Execution Records in the Operation column to view the task execution details (such as task name/ID/status, execution time, and reviewer).

Deleting a task

Click Delete in the Operation column to delete a task. You can delete a task only when the task is closed.

Searching for a task

You can search for tasks by task name, creator, modifier, latest execution result, task type, and enterprise project. Enter a keyword in the search box in the upper right corner and click .

Hiding/Showing columns in the task list

Click and select or deselect columns to display.

Refreshing the task list

Click to refresh the task list.