tasksched

check_tasksched

Check status of scheduled jobs

Implementation

WindowsLinuxFreeBSDMacOSX

Examples

Default Check

check_tasksched
OK - All tasks are ok

Example using NRPE and Naemon

Naemon Config

define command{
    command_name         check_nrpe
    command_line         $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$
}

define service {
    host_name            testhost
    service_description  check_tasksched
    use                  generic-service
    check_command        check_nrpe!check_tasksched!'crit=exit_code != 0'
}

Argument Defaults

ArgumentDefault Value
filterenabled = true
warningexit_code != 0
criticalexit_code < 0
empty-state3 (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

ArgumentDescription
folderThe folder where the scheduled task is saved. This is used for exact matches, unless recursive option is enabled. Default: ‘'
hiddenInclude hidden tasks. Default: ‘false’
recursiveInclude the subfolders of the specified folder as well when searching for scheduled tasks. Default: ’true’
timezoneSets the timezone for time metrics (default is local time)
titleSets the task to check. This corresponds to the title of the scheduled task. Default: ‘*’

Attributes

Filter Keywords

these can be used in filters and thresholds (along with the default attributes):

AttributeDescription
applicationName of the application that the task is associated with
commentComment or description for the work item
creatorCreator of the work item
enabledFlag whether this job is enabled (true/false)
exit_codeThe last jobs exit code
exit_stringThe last jobs exit code as string
folderTask folder
uriFully qualified path to the task, includes folder and the task title
uri_cleanRemove the leading backslash from the URI, only for tasks directly saved at root and not for ones saved inside folders.
has_runTrue if this task has ever been executed
max_run_timeMaximum length of time the task can run
most_recent_run_timeMost recent time the work item began running
priorityTask priority
titleTask title
hiddenIndicates that the task will not be visible in the UI (true/false)
missed_runsNumber of times the registered task has missed a scheduled run
task_statusTask status as string
next_run_timeTime when the registered task is next scheduled to run
parametersLast actions command line parameters
executeLast actions executed program
working_directoryLast actions working directory