This project contains the steps to configure zabbix-agent based monitoring for the docker container(using linux cgroups) which are running inside docker-swarm.
This project focuses on configuring basic docker monitoring using zabbix-agent.The metric related with docker container which would be monitored as part of this project is mentioned below:
- CPU utilization(%)
- Memory utilization(%)
- Used cache memory(Bytes)
- Total page fault(Bytes)
- Used RSS memory(Bytes)
- Used swap memory(Bytes)
Following points needs to be fulfilled before starting the implementation:
- Docker container should be running inside docker-swarm on the server which needs to be monitored.
- Docker API should be enabled and accessible by running the command "curl --silent --unix-socket /var/run/docker.sock http:/containers/json".
- Docker container should be mounted on the cgroup.This could be checked by running the command "ls -ltra /sys/fs/cgroup/cpu/docker/[CONTAINER-ID]".(Note:Replace "[CONTAINER-ID]" in the command with the your docker container id)
- This project was built on Python 2.7.5 hence the same Python version or any latest version compatible with Python 2.7.5 would be required.
- This project has been tested and implemented on "Red Hat Enterprise Linux Server 7.2 (Maipo)" and may not work on any other Linux distribution.
Follow the below mentioned steps to configure docker monitoring using zabbix-agent
- COPY the userparameter_docker.conf file in the "/etc/zabbix/zabbix_agentd.d/" directory on the server(aka HOST-ONE) running the zabbix-agent.
- COPY the DockerMonitoring.py file in the "/etc/zabbix/" directory on the same server(aka HOST-ONE) running the zabbix-agent.
- RESTART the zabbix-agent using the command "systemctl restart zabbix-agent" running on the same server(aka HOST-ONE).
- IMPORT the zbx_docker_templates.xml template from the Zabbix frontend.(for any help related with importing the template: click here)
- APPLY the zbx_docker_templates.xml template on the same server(aka HOST-ONE) containing the zabbix-agent.(for any help related with applying the template on host: click here)
-
First try to troubleshoot problems yourself. Increase debug level and check the agent logs. Try to obtain raw values from the agent.
-
Other options:
- Try to ask Zabbix community http://www.zabbix.org/wiki/Getting_help
- If you need support directly then send an email to mohitrajvardhan17@gmail.com for support.
All reported issues, which are not real issues, but requests for support will be closed with reference to this README section.
This project is licensed under the terms of the GNU General Public License v3.0 license.