Monitoring docker with zabbix
Monitoring docker host could be a painful operation that could require too much configurations under every container that are running in the same host. In my case if you are using docker as a powerful alternative to shared hosting, the monitoring process could be a critical part of the operations.
For this article I’m using :
- Zabbix 3.0
- docker host 1.10.3
- docker hub
A container to monitor other containers
There is a cool project called: Zabbix Agent 3.0 XXL with Docker/systemd monitoring that provides the container you need to collect data. Simply run command:
docker run --name=zabbix-agent-xxl -h $(hostname) -p 10050:10050 -v /:/rootfs -v /var/run:/var/run -e "ZA_Server=XX.YY.ZZ.KK" -d monitoringartist/zabbix-agent-xxl-limited:latest
Sure… you have to specify your zabbix server by changing ZA_Server parameter.
That’s all from the host side.
From container side
Than you should configure template and host to monitor:
- Following the guide (https://hub.docker.com/r/monitoringartist/zabbix-agent-xxl-limited/ ) you should download related zabbix xml template from this link https://github.com/monitoringartist/zabbix-agent-xxl/tree/master/template
- In zabbix administration add host and associate the zabbix template
Now you can watch what’s going in your docker host, simply clicking “latest data” menu in zabbix.
That’s all and thanks to Paolo Capelli ( @polcape )