I would like to monitor my Ansible playbooks with Icinga2.
The background is that the playbooks are configured at night and I would like to get a notification in the monitoring when an error occurs. When a playbook fails the error is triggered in ansible.log.
Does anyone of you have experience or ideas how I can best monitor my Ansible playbooks?
You could implement a passive check in icinga.
the service uses the dummy checkcommand which is always ok.
if your ansible playbook runs at night it should send as part of the playbook a result to icinga for the passive check created earlier. use process-check-result via api to get the information into icinga
Use a log check like logfile from Linuxfabrik and use pattern failed=[1-9]. I can recommend the one form Linuxfabrik because if you setup the API user you donβt need to rotate the log as acknowledging the service will tell the check to ignore the old problems and only check for new ones.