How to export all the running and past Task information from Satellite 6?

Solution Verified - Updated

Environment

  • Red Hat Satellite 6

Issue

  • A Satellite user wishes to export historical and currently running Task information from the Satellite 6 installation. This is all the information found in Monitor -> Tasks.

Resolution

Note For many tasks to be exported, the (partially) deprecated rake script foreman_tasks:export_tasks is known to be time and memory very demanding. In such case, it is highly recommended to collect *.csv files - for this purpose you can create a sosreport which includes these exports. Otherwise, use the rake script just for exporting specific tasks, and not all/many of them.

Execute one of the following commands when logged in as root. The commands will end up with a log like Created /tmp/task-export-1417552930.tar.gz - provide the tarball to Red Hat support, please.

* To export *all* tasks (this may take some time and memory):

        # foreman-rake foreman_tasks:export_tasks TASK_SEARCH=''

* Export all tasks using configured defaults (all tasks started within the last 7 days AND all unsuccessful finished tasks from the last 60 days):

        # foreman-rake foreman_tasks:export_tasks

* Export tasks from last several days:

        # foreman-rake foreman_tasks:export_tasks TASK_SEARCH='' TASK_DAYS=3

* Export tasks since particular date:

        # foreman-rake foreman_tasks:export_tasks TASK_SEARCH="started_at > '2017-10-15 00:00:00'"

* Export tasks till particular date:

        # foreman-rake foreman_tasks:export_tasks TASK_SEARCH="started_at < '2017-10-15 00:00:00'"

* Export a specific type of task using the label:

        # foreman-rake foreman_tasks:export_tasks TASK_SEARCH="label=Actions::Katello::CapsuleContent::Sync"

 * Export multiple type of tasks using labels:

        # foreman-rake foreman_tasks:export_tasks TASK_SEARCH="label=Actions::Katello::CapsuleContent::Sync or label=Actions::BulkAction"

* Export task with specific ID:

        # foreman-rake foreman_tasks:export_tasks TASK_SEARCH="id=ad8fbd66-2b63-433a-991c-ff2839193ea9"

For more KB articles/solutions related to Red Hat Satellite 6.x Satellite Tasking System Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Satellite Tasking System Issues.

SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.