in DevOps, System Administration

Ansible and Monit for simple server monitoring and documentation

A month ago a customer asked me to help him with his server monitoring. My first step was to evaluate what servers were running what services, so I turned to the customer’s developers for a list of services per host. Long story short – there wasn’t any kind of server documentation. So a second task emerged: Write a server documentation. Why not kill two birds with one stone?

An excellent solution for monitoring your servers and services is monit. Their site provides a good overview of what monit can do for you.
My new favourite tool for simple task automation is ansible. So why not combine them both?

Browsing ansible galaxy I found a nice role that fits my needs: https://galaxy.ansible.com/detail#/role/322
For this example I will use blog.entwicklerbier.org and jabber.entwicklerbier.org as monitored and documented hosts.

The final product can be seen here: https://github.com/kh0r/ansible-monit. I committed tutorial-style, so be sure to have a look at the commit history.

If you have any questions or want to know how I centralized the monitoring using mmonit, feel free to write a comment or contact me.