check_tasksched
Check the status of scheduled tasks.
Implementation
| Windows | Linux | FreeBSD | macOS |
|---|
| ✅ | | | |
Argument Defaults
| Argument | Default Value |
|---|
| filter | enabled = true |
| warning | exit_code != 0 |
| critical | exit_code < 0 |
| empty-state | 3 (UNKNOWN) |
| empty-syntax | %(status) - No tasks found |
| top-syntax | %(status) - %(problem_list) |
| ok-syntax | %(status) - All tasks are ok |
| detail-syntax | %(uri_clean) (%(most_recent_run_time:date)) exited with %(exit_code) |
Check Specific Arguments
| Argument | Description |
|---|
| folder | Folder that contains the scheduled task. Matches this folder exactly unless recursive is enabled. Default: ‘' |
| hidden | Include hidden tasks. Default: ‘false’ |
| recursive | Search subfolders of the specified folder for scheduled tasks. Default: ’true’ |
| timezone | Set the timezone for time metrics (default is local time) |
| title | Title of the scheduled task to check. Default: ‘*’ |
Attributes
Filter Keywords
Use these attributes in filters and thresholds, along with the default attributes:
| Attribute | Description |
|---|
| application | Name of the application that the task is associated with |
| comment | Comment or description for the work item |
| creator | Creator of the work item |
| enabled | Flag whether this job is enabled (true/false) |
| exit_code | The last job’s exit code |
| exit_string | The last job’s exit code as string |
| folder | Task folder |
| uri | Full path to the task, including the folder and task title |
| uri_clean | URI without the leading backslash for tasks directly at root. Tasks inside folders keep their leading backslash. |
| has_run | True if this task has ever been executed |
| max_run_time | Maximum length of time the task can run |
| most_recent_run_time | Most recent time the work item began running |
| priority | Task priority |
| title | Task title |
| hidden | True if the task is hidden in the UI (true/false) |
| missed_runs | Number of scheduled runs that the registered task missed |
| task_status | Task status as string |
| next_run_time | Time when the registered task is next scheduled to run |
| parameters | Last action’s command line parameters |
| execute | Last action’s executed program |
| working_directory | Last action’s working directory |
Examples
Default Check
check_tasksched
OK - All tasks are ok
Example using check_snclient and Naemon
Naemon Config
define command{
command_name check_snclient
command_line $USER1$/check_snclient -k -p 'your-password' -u 'https://$HOSTADDRESS$:8443' $ARG1$ $ARG2$
}
define service {
host_name testhost
service_description check_tasksched
use generic-service
check_command check_snclient!check_tasksched!'crit=exit_code != 0'
}