We run several ansible playbooks each day for our hosts full automated. Each status is then mailed to our team. Is there a module or easy way to send the playbook results directly to checkmk? I found a lot about ansible automated installs of checkmk components or configuration of sites but nothing in my direction.
How are you running the playbooks? From a scheduling app such as Rundeck, via AWX, or cron?
One generic approach could be to write output to a file as the final task in the playbook and write a local check to test the success/fail condition.
Alternatively you could set the syslog options for Ansible output and use the Event Console to handle the messages as required.
We use cron - its a small environment. Using local checks is an option (we use very often) but I expected to find some modules already available. Event cosole is an idea, but we do not use it till now.
Thx
You can use mk-job
for that: Monitoring time-based processes (Cronjobs)
Another possibility is to convert them to systemd timers. The effect is that
- the output is available via the journal without redirection magic
- CheckMK monitors systemd service status out of the box, meaning a failing timer invocation will be noticed by CheckMK right away without any kind of special setup
Thanks for suggestions. I will have a closer look at systemd timers and mk-job.