Page 1 of 1

Calling the Ansible REST API from Nagios XI

Posted: Thu Nov 17, 2022 11:04 pm
by SharphSonirak
Has anyone been able to figure out how to have Nagios XI call an external Ansible Playbook for self-healing of a server. This works with a curl command. Is there anyway to create an event handler for calling Ansible Tower REST API? My working curl command looks like this -

curl -k -X POST \

-H "Authorization: Bearer TOKEN" \

-H "Content-Type: application/json" \

--data '{"extra_vars": "{\"target_fqdn\": \"server1.domain.com\"}"}' \

https://192.xxx.xx.xxx/api/v2/job_templates/76/launch/