million12 / docker-zabbix-agent

Zabbix Agent Docker Image (CentOS 7)
MIT License
18 stars 10 forks source link

Agent send wrong traffic data on eth0 #2

Open alexishida opened 8 years ago

alexishida commented 8 years ago

I used this configuration:

docker run \ -d \ --restart=always \ -p 10050:10050 \ --name=zabbix-agent \ --volume=/:/rootfs:ro \ --volume=/var/run:/var/run:rw \ --volume=/sys:/sys:ro \ --volume=/var/lib/docker/:/var/lib/docker:ro \ --env="ZABBIX_SERVER=" \ million12/zabbix-agent

and data on eth0 is wrong.

Ubuntu 14.04 Docker version 1.10.1, build 9e83765

pozgo commented 8 years ago

Can you try with --privileged and let us know if that works?

alexishida commented 8 years ago

It's still not working :(

I had installed cadvisor for test and it works.

pozgo commented 8 years ago

What version of Zabbix Server are you using? It was tested only on 2.4.x versions, not 3+

alexishida commented 8 years ago

Zabbix Server 3.0 all metrics works fine, only eth0 not work!

pozgo commented 8 years ago

I think it needs to be rebuild within zabbix 3 rather than 2. I'm pretty busy at the moment but if time allows I'll try to update it to version 3.x. Unless someone wants to do this and send us PR. :)

pozgo commented 8 years ago

@alexishida image has been rebuild with zabbix agent 3.0.1

Hopefully, that will solve your issues.

alexishida commented 8 years ago

docker run \ -d \ --privileged \ --restart=always \ -p 10050:10050 \ --name=zabbix-agent \ -v /proc:/data/proc \ -v /sys:/data/sys \ -v /dev:/data/dev \ -v /var/run/docker.sock:/var/run/docker.sock \ --env="ZABBIX_SERVER=ip" \ million12/zabbix-agent:3.0.1

This new agent still send wrong eth0 metrics :(

KostyaEsmukov commented 7 years ago

Same here with the million12/zabbix-agent:2.4.7. But I get this on CentOS systems only. Debian and Ubuntu ones does not have this problem.

KostyaEsmukov commented 7 years ago
$ docker run \
    -it --rm \
    -v /proc:/data/proc:Z \
    -v /sys:/data/sys:Z \
    -v /dev:/data/dev:Z \
    --privileged \
    --entrypoint=sh \
    million12/zabbix-agent:2.4.7 \
    -c 'cat /proc/net/dev && cat /data/proc/net/dev'
Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
  eth0:      90       1    0    0    0     0          0         0       90       1    0    0    0     0       0          0
    lo:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
  eth0:      90       1    0    0    0     0          0         0       90       1    0    0    0     0       0          0
    lo:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0

The output is obviously not the same as on the host. This issue is probably SELinux-related.