The tasks page can be accessed via The Monitor Menu:
Monitor > Tasks
Actions performed in orcharhino, that may require an extended period of time to execute, or can be scheduled to run regularly or at a specific point in time, are often run as so called tasks. Tasks may also be used for the interaction between separate orcharhino background services. (One service might schedule a task that is performed by a different service).
The following is an incomplete list of actions that are run as tasks:
- Most actions performed by orcharhino’s content management. (See also: Content Management Guide).
- All remote execution actions. (See also Remote Execution Guide).
- Bulk actions (which will generally create a parent task, with sub tasks for each object the bulk action is performed on).
The tasks page lists all tasks performed throughout orcharhino (sorted by start time, with newer tasks on top). It also reports the state and result of each task (see Task Attributes below), as well as the user that performed it (this may be an internal administrative user).
As a result, the tasks page shares some overlap and similarities with the audits page (see also: Audits) though it’s purpose is different. (The tasks page exists to list actions that run as a task, while the audits page exists to show which orcharhino users have performed which actions).
The tasks page includes an Export button and a list of tasks that have run, are running, or have been scheduled to run on orcharhino:
- The Export button (1) will export the current list of tasks (2) to a CSV file.
- Clicking on the name of a task in the Action column (3) of the list of tasks (2), will open the task overview window (of that task). (See also Viewing a Task below).
- The State and Result columns (4) are of particular interest when dealing with tasks. (See Task Attributes below for a detailed explanation).
The comprehension of the State and Result attributes is of particular importance when dealing with tasks. The following tables detail the possible values of these attributes (along with a description):
|planned||The task is waiting for the foreman-tasks service to run it.|
|running||The task has started (but not finished) running.|
|stopped||The task has stopped running. (Check the Result attribute to see what happened).|
|paused||The task has encountered a problem and is waiting for a manual resolution. (Recovery from the error may still be possible).|
|pending||A “result” has yet to be established. (The task may not have started yet or still be running).|
|success||The task was completed successfully.|
|error||The task has encountered an error. (Check the State attribute to see if manual recovery may be possible).|
|warning||The task encountered an error, but was manually resumed and then completed successfully.|
|cancelled||The task was manually cancelled. (Only possible for some tasks).|
Viewing a Task¶
The task overview window (for a given task) can be accessed via the list of tasks:
Monitor > Tasks >> list of tasks > Action column > description of task
We will consider the following (trivial) remote execution task (see also Remote Execution Guide) as an example (the example task issues the command
echo $HOSTNAME to two hosts):
- Note that there are additional tabs (1). These tabs are primarily of interest when troubleshooting a task with errors. (See Troubleshooting a Task below).
- The Start auto-reloading button (2) exists to update the task overview window when viewing a running task. It has no effect on the underlying task itself.
- The Resume (3) and Cancel (4) buttons are primarily of interest when troubleshooting. (See Troubleshooting a Task below).
- The Sub tasks button (5) (only present if the task being viewed has one or more sub tasks) will take you to the tasks page filtered to show only sub tasks of the task being viewed.
Bulk action tasks like “remotely execute the command
echo $HOSTNAMEon the following hosts” will often spawn a separate sub task for each of those hosts.
- The Result (6) and State (10) attributes are prominently displayed. (See also Task Attributes above.)
- The Triggered by field (7) will display the orcharhino user (see also User Management Guide) that triggered the task. (In this example the “admin” user. However, this can also be an internal administrative user.)
- The Execution type (8) can be immediate or delayed. Tasks that are scheduled to execute at a specific time will be delayed.
- The various time fields (9) specify when the task was scheduled to start, when it did indeed start, when it ended, and after what time it should no longer be started.
Troubleshooting a Task¶
Tasks are of particular importance for troubleshooting purposes, since they are used for the interaction between different system components. Any number of things can go wrong with such interactions, and the foreman-tasks plugin provides inbuilt functionality for troubleshooting and recovery.