Hi,
I'm running netdata as a container in a QNAP environment and would like to monitor other containers with the name as the label instead of the ID.
I went throughout other similar issues but all was referring to missing docker.sock mount or PGID
This is the docker-compose used:
version: '3'
services:
netdata:
image: netdata/netdata
hostname: XXX
ports:
- 19999:19999
cap_add:
- SYS_PTRACE
security_opt:
- apparmor:unconfined
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- PGID=0
On the host there isn't a docker group, so I set the PGID to the group ID of the user that runs dockerd (0)
The docker.sock is correctly mounted in the container:
srw-rw---- 1 root root 0 Apr 1 08:08 docker.sock
And this is from the host:
srw-rw---- 1 admin administrators 0 2019-04-01 10:08 docker.sock
with ID (from host):
srw-rw---- 1 0 0 0 2019-04-01 10:08 docker.sock
this is the netdata IDs:
uid=201(netdata) gid=201(netdata) groups=30(readproc),70(postgres),80(cdrw),200(nofiles),201(netdata),300(abuild)
Seems still a permission issue:
2019-04-09 12:25:52: cgroup-name.sh: INFO: Running API command: /containers/63a4bf87a8432bd47a70bd8545f33108a1da6f6adf529b7fb83c0bff465508d9/json,
nc: unix connect failed: Permission denied,
2019-04-09 12:25:53: cgroup-name.sh: WARNING: cannot find the name of docker container '63a4bf87a8432bd47a70bd8545f33108a1da6f6adf529b7fb83c0bff465508d9',
2019-04-09 12:25:53: cgroup-name.sh: INFO: cgroup 'docker_63a4bf87a8432bd47a70bd8545f33108a1da6f6adf529b7fb83c0bff465508d9' is called '63a4bf87a843',
2019-04-09 12:25:53: /usr/libexec/netdata/plugins.d/cgroup-network INFO : MAIN : Using host prefix directory '/host',
2019-04-09 12:25:53: /usr/libexec/netdata/plugins.d/cgroup-network INFO : MAIN : running: exec /usr/libexec/netdata/plugins.d/cgroup-network-helper.sh --cgroup '/host/sys/fs/cgroup/cpuacct/docker/63a4bf87a8432bd47a70bd8545f33108a1da6f6adf529b7fb83c0bff465508d9',
2019-04-09 12:25:53: cgroup-network-helper.sh: INFO: searching for network interfaces of cgroup '/host/sys/fs/cgroup/cpuacct/docker/63a4bf87a8432bd47a70bd8545f33108a1da6f6adf529b7fb83c0bff465508d9',
2019-04-09 12:25:53: /usr/libexec/netdata/plugins.d/cgroup-network ERROR : MAIN : child pid 1661 exited with code 1.,
2019-04-09 12:25:53: /usr/libexec/netdata/plugins.d/cgroup-network ERROR : MAIN : Cannot find a cgroup PID from cgroup '/host/sys/fs/cgroup/cpuacct/docker/63a4bf87a8432bd47a70bd8545f33108a1da6f6adf529b7fb83c0bff465508d9',
Moreover I see this error when netdata starts, dunno if correlated or expected:
2019-04-09 12:25:29: python.d INFO: plugin[checker] : dockerd : checking,
2019-04-09 12:25:29: python.d INFO: plugin[checker] : dockerd : source successfully loaded,
2019-04-09 12:25:29: python.d INFO: plugin[checker] : dockerd : found config file '/usr/lib/netdata/conf.d/python.d/dockerd.conf',
2019-04-09 12:25:29: python.d INFO: plugin[checker] : dockerd : created 1 job(s) from the config,
2019-04-09 12:25:29: python.d ERROR: dockerd[local] : 'docker' package is needed to use dockerd module,
2019-04-09 12:25:29: python.d INFO: plugin[checker] : dockerd[local] : check failed, skipping the job,
2019-04-09 12:25:29: python.d INFO: plugin[checker] : dockerd : all jobs failed, skipping module,
I'm using the official netdata:latest docker image:
Your netdata version: v1.14.0-rc0-39-g0d4da488
Could the groupID of 0 making trouble since in the container the same ID is used for the root group?
Can you help me to fix this?
Thanks and regards,