This article explains how to configure Cydarm to create cases on a schedule. This can be useful for daily or weekly tasks that need to be tracked and actioned.
Overview
The System property ADMIN_SCHEDULED_TASKS
can be used to generate cases according to a schedule. A common use case for this is to create cases for performing daily or weekly tasks, such as validating detection systems, or checking on-call system.
You may wish to automatically add a playbook to the created case - for example, a playbook for the daily or weekly checks. This can be done by Configuring automatic tagging, and Automatically adding a playbook via tags.
Usage
TheADMIN_SCHEDULED_TASKS
system property defines a scheduled tasks that will be executed at regular intervals. The scheduled task is defined by a ScheduledTask object, which contains the following fields:- timezone: The timezone in which the scheduled task should be executed
- schedule: The cron expression that defines the schedule for the scheduled task
- task: The name of the task to be executed
- args: A `ScheduledTaskArg` object that contains additional arguments for the task
- description: A description of the task
- org: The organization for which the task should be executed
Example
The following example shows a sampleADMIN_SCHEDULED_TASKS
system property:
[
{
"timezone": "Australia/Brisbane",
"schedule": "0 14 * * 5",
"task": "create-case",
"args": {
"description": "Perform weekly on-call checks",
"org": "Acme Corporation"
}
}
]
This scheduled task will create a new case for weekly on-call checks at 14:00 every Friday in AEST.
Usage
To use the ADMIN_SCHEDULED_TASKS
system property, you must first define the scheduled tasks that you want to execute. You can do this by creating a JSON string that contains an array of ScheduledTask objects. It can then be added as a system property - ensure that Admin only is not ticked.
Once the scheduled task has been defined, it will be executed at the intervals specified in the cron expressions. The system will automatically restart any scheduled tasks that fail.
Troubleshooting
Check the following:
- That the field names in the JSON are correctly spelled and all in lower case - it is case sensitive.
- That the Organization specified is correct - it is case sensitive.
- That the timezone is a valid timezone. Find the appropriate timezone in the timezone picker displayed in Cydarm and use that.
- Validate that the cron expression used in the schedule field is valid and corresponds to your desired schedule.
If you are still having issues:
- If you are a hosted customer, please log a support ticket.
- If you are an enterprise customer, search debug logs for unique text included in the system property string (eg the case name from above - "c0-001-oncall_chk:"). Look for subsequent log events relating to installation of cron jobs. Log a support ticket for further assistance if required and include relevant log entries.
For more detailed technical information please refer to our Cydarm API documentation.