Docker is a perfect tool to quickly create many environments to new services. That creation process is so easy, in some cases this is done automatically by other tool or script.
Problems can happens and IT team should be ready to figure it out before causing unavailability.
How can a monitoring team follow this quickly creation process and keep all this new assets in monitoring system? We need to automatically monitor all containers.
I developed some scripts to list docker containers, add it in Zabbix using LLD feature and monitor these new hosts.
Unfortunately we need special access to monitor that information in docker, so I used sudo and root cron job.
Follow the items monitored by this solution:
- CPU used percent
- Memory used percent
- Bytes received and sent per second
- Packages received and sent
- Packages received and sent, but dropped
- Packages received and sent with erros
Do you wanna know the solution before test? Take a look at the video:
I tested tested in the follow environment:
- python 2.7.9
- docker 1.6
- zabbix agent and server 2.4
If you test in a different one, please let me know.