Monitoring AWX Job Status via API and Counting Failed/Completed Jobs

Hi Ansible community,

I’m working with AWX (Ansible Tower) and need assistance with two tasks:

  1. Monitoring AWX Job Status:
    I want to retrieve detailed information about AWX job status using the REST API. Specifically, I’d like to know how to get custom information during an ongoing job (e.g., additional fields beyond the default status).

  2. Counting Failed and Completed Jobs:
    I’m looking for API queries to identify the count of failed and completed jobs. Ideally, I’d like to get these counts per hour and per day.

Any guidance or examples would be greatly appreciated!

you can use the job_list module for example:
https://docs.ansible.com/ansible/latest/collections/awx/awx/job_list_module.html

and if you want to go directly towards api it should be this endpoint:
https://ansible.readthedocs.io/projects/awx/en/latest/rest_api/api_ref.html#/Jobs/Jobs_jobs_list
or
https://ansible.readthedocs.io/projects/awx/en/latest/rest_api/api_ref.html#/Jobs/Jobs_jobs_read_0

1 Like