So, you have Ansible Tower installed in your environment and now you just need to find a way to make sure everything is working smoothly and as expected. The bonus is – you can use automation with the API.
Ansible Tower API Monitoring
Ansible Tower provides several mechanisms which can be used for monitoring of the standalone Ansible Tower and clustered Ansible Towers.
The following API call, provides information about the cluster health:
https://tower_fqdn/api/v2/ping/
The following example output can be expected when both instances (application nodes) are active. Notice the value assigned to variable ‘capacity’:
In case one of the nodes is down, the capacity of the solution changes:
Another useful API call is: https://ansible_fqdn/api/v2/metrics/
This call provides the information about system related metrics, including the available capacity of the nodes. For example:
The following example provides additional information about the licensing status of the Ansible Tower; the number of licensed nodes vs used licenses; the license expiration time; licensed features etc:
https://tower_fqdn/api/v2/config/
The following API call can be used to measure the performance and collect the data for performance plotting. It also provides insight into a job distribution and can help with the job allocation in busy environments.
Note the capacity, committed capacity, jobs_running and jobs_total. Values of those variables can provide insight into job slicing and job allocation. It can be also used to validate if another cluster node should be added to increase the capacity of the cluster:
https://tower_fqdn/api/v2/instance_groups/
Note the API provides the metrics for each individual instance group. This implies each individual instance group can be queried for specific information. This data can be used to plot graphs presenting utilisation of each instance group. For example:
https://tower_fqdn/api/v2/instance_groups/1/
Ansible Tower offers even more API calls. Please refer to the following link, to verify available APIs:
https://tower_fqdn/api/v2/
For more information on Ansible Tower API, please refer to the following documentation:
https://docs.ansible.com/ansible-tower/latest/html/towerapi/index.html