Fortinet black logo

New Features

Enhance automation trigger to execute only once at a scheduled date and time 7.2.1

Copy Link
Copy Doc ID 77966226-6996-11ec-bdf2-fa163e15d75b:453129
Download PDF

Enhance automation trigger to execute only once at a scheduled date and time 7.2.1

The Schedule automation trigger has been updated to allow one-time triggers that occur only once at a specified date and time. This trigger can be used to support one-time automation actions, including one-time configuration backup to a disk, a reboot, or a shutdown.

config system automation-trigger
    edit <name>
        set trigger-type scheduled
        set trigger-frequency once
        set trigger-datetime <YYYY-MM-DD HH:MM:SS>
    next
end

Example

In this example, an automation stitch is created to trigger a one-time configuration backup to a disk. The backup will occur August 5, 2022 at 4:00 AM.

To schedule a one-time automation stitch in the GUI:
  1. Configure the trigger:

    1. Go to Security Fabric > Automation, select the Trigger tab, and click Create New.

    2. In the Miscellaneous section, click Schedule.

    3. Enter a name (schedule-once) in the Name field.

    4. In the Frequency dropdown list, select Once.

    5. Select when the trigger will occur in the Date/Time fields.

    6. Click OK.

  2. Configure the action:

    1. Go to Security Fabric > Automation, select the Action tab, and click Create New.

    2. In the General section, click System Action.

    3. Enter a name (Backup config disk) and an action description.

    4. In the Action dropdown list, select Backup configuration.

    5. Click OK.

  3. Configure the stitch:

    1. Go to Security Fabric > Automation, select the Stitch tab, and click Create New.

    2. Enter the name, backup-once.

    3. Click Add Trigger. Select schedule-once and click Apply.

    4. Click Add Action. Select Backup config disk and click Apply.

    5. Click OK. The backup configuration will occur once at the date and time you set.

To schedule a one-time automation stitch in the CLI:
  1. Configure the trigger:

    config system automation-trigger
        edit "schedule-once"
            set trigger-type scheduled
            set trigger-frequency once
            set trigger-datetime 2022-08-05 04:00:00
        next
    end
  2. Configure the action:

    config system automation-action
        edit "Backup config disk"
            set description "Default automation action configuration for backing up the configuration on disk."
            set action-type system-actions
            set system-action backup-config
        next
    end
  3. Configure the stitch:

    config system automation-stitch
        edit "backup-once"
            set trigger "schedule-once"
            config actions
                edit 1
                    set action "Backup config disk"
                    set required enable
                next
            end
        next
    end
  4. To view automation stitch information:

    # diagnose test application autod 3
    stitch: backup-once (scheduled)
    
            local hit: 0 relayed to: 0 relayed from: 0
            last trigger:   last relay:
            next scheduled trigger:Fri Aug  5 05:00:00 2022
            actions:
                    backup config disk:
                            done: 0 relayed to: 0 relayed from: 0
                            last trigger:                   last relay:
    
    logid to stitch mapping:
    id:0 (scheduled stitches) local hit: 0 relayed hits: 0
            backup-once

Enhance automation trigger to execute only once at a scheduled date and time 7.2.1

The Schedule automation trigger has been updated to allow one-time triggers that occur only once at a specified date and time. This trigger can be used to support one-time automation actions, including one-time configuration backup to a disk, a reboot, or a shutdown.

config system automation-trigger
    edit <name>
        set trigger-type scheduled
        set trigger-frequency once
        set trigger-datetime <YYYY-MM-DD HH:MM:SS>
    next
end

Example

In this example, an automation stitch is created to trigger a one-time configuration backup to a disk. The backup will occur August 5, 2022 at 4:00 AM.

To schedule a one-time automation stitch in the GUI:
  1. Configure the trigger:

    1. Go to Security Fabric > Automation, select the Trigger tab, and click Create New.

    2. In the Miscellaneous section, click Schedule.

    3. Enter a name (schedule-once) in the Name field.

    4. In the Frequency dropdown list, select Once.

    5. Select when the trigger will occur in the Date/Time fields.

    6. Click OK.

  2. Configure the action:

    1. Go to Security Fabric > Automation, select the Action tab, and click Create New.

    2. In the General section, click System Action.

    3. Enter a name (Backup config disk) and an action description.

    4. In the Action dropdown list, select Backup configuration.

    5. Click OK.

  3. Configure the stitch:

    1. Go to Security Fabric > Automation, select the Stitch tab, and click Create New.

    2. Enter the name, backup-once.

    3. Click Add Trigger. Select schedule-once and click Apply.

    4. Click Add Action. Select Backup config disk and click Apply.

    5. Click OK. The backup configuration will occur once at the date and time you set.

To schedule a one-time automation stitch in the CLI:
  1. Configure the trigger:

    config system automation-trigger
        edit "schedule-once"
            set trigger-type scheduled
            set trigger-frequency once
            set trigger-datetime 2022-08-05 04:00:00
        next
    end
  2. Configure the action:

    config system automation-action
        edit "Backup config disk"
            set description "Default automation action configuration for backing up the configuration on disk."
            set action-type system-actions
            set system-action backup-config
        next
    end
  3. Configure the stitch:

    config system automation-stitch
        edit "backup-once"
            set trigger "schedule-once"
            config actions
                edit 1
                    set action "Backup config disk"
                    set required enable
                next
            end
        next
    end
  4. To view automation stitch information:

    # diagnose test application autod 3
    stitch: backup-once (scheduled)
    
            local hit: 0 relayed to: 0 relayed from: 0
            last trigger:   last relay:
            next scheduled trigger:Fri Aug  5 05:00:00 2022
            actions:
                    backup config disk:
                            done: 0 relayed to: 0 relayed from: 0
                            last trigger:                   last relay:
    
    logid to stitch mapping:
    id:0 (scheduled stitches) local hit: 0 relayed hits: 0
            backup-once