monitoringartist / zabbix-docker-monitoring

:whale: Docker/Kubernetes/Mesos/Marathon/Chronos/LXC/LXD/Swarm container monitoring - Docker image, Zabbix template and C module
https://hub.docker.com/r/monitoringartist/zabbix-agent-xxl-limited/
GNU General Public License v2.0
1.19k stars 268 forks source link

Centos 7.5 image unable to monitor some docker parameters. #120

Closed aguzmans closed 5 years ago

aguzmans commented 5 years ago

hi, I managed to compile and image of the agent with the docker module. No issue there and the zabbix is running and I can get some data from it, but some of the basic docker monitoring does not work. Let me show you:

`sh-4.2# zabbix_agentd -t docker.images[dangling] -c /etc/zabbix/zabbix_agentd.conf docker.images[dangling] [t|REPOSITORY TAG IMAGE ID CREATED SIZE

57b9a3c60023 11 hours ago 651MB 41a079372462 12 hours ago 651MB 17006e6e3ab0 20 hours ago 337MB 37945cebc85e 23 hours ago 203MB 290539b11f9e 23 hours ago 651MB ed01efe4834c 2 days ago 619MB 5303178f8fae 2 days ago 929MB] sh-4.2#` What does not work? Well most things: `sh-4.2# zabbix_agentd -t docker.cpu[/con_srv_nc_zbx_vagrant_abel_test16,system] -c /etc/zabbix/zabbix_agentd.conf docker.cpu[/con_srv_nc_zbx_vagrant_abel_test16,system] [m|ZBX_NOTSUPPORTED] [docker.cpu check is not available at the moment - no cpu_cgroup directory] sh-4.2# sh-4.2# zabbix_agentd -t docker.images[ServerVersion] -c /etc/zabbix/zabbix_agentd.conf docker.images[ServerVersion] [t|-0.9901] sh-4.2# ` My system is centos 7.5. I am running docker installed using official docs. If from inside the container I try to get CPU information I am able to get it: `sh-4.2# cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 61 model name : Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz stepping : 4 cpu MHz : 1600.000 cache size : 3072 KB physical id : 0 siblings : 1 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0` For the build I used the[ official zabbix Dockerfile](https://github.com/zabbix/zabbix-docker/tree/4.2/agent/centos) build files and just added the docker modules. This is the way I added the module in my compilation: ``` RUN git clone -q https://github.com/monitoringartist/zabbix-docker-monitoring RUN cd /tmp/zabbix-${ZBX_VERSION} && \ cp -R ~/zabbix-docker-monitoring/src/modules/zabbix_module_docker/ /tmp/zabbix-${ZBX_VERSION}/src/modules/ && \ cd /tmp/zabbix-${ZBX_VERSION}/src/modules/zabbix_module_docker && \ make ``` The agent version is 4.x What am I doing wrong or is this a bug?
jangaraj commented 5 years ago

You are running Zabbix agent in the container, so some cgroup limitations are there. Module doesn't support running in the container out of the box - you can hack it, but you need deeper Docker/cgroup knowledge (that is not in the scope of this project). I published own image https://github.com/monitoringartist/dockbix-agent-xxl where many of limitations sorted out.

aguzmans commented 5 years ago

Hi Thanks for the prompt response. I tried to build using your base docker file, but it did not work for me... I also need to add a lot of other customized things. I guess this leaves me 2 options: 1- Try to go back to your build file and figure out what went wrong before. 2- Keep going with this and learn more about cgroups, etc.

Again, thanks for the help.