Install netdata with Docker

Run netdata with docker command

Quickly start netdata with the docker command line. Netdata is then available at http://host:19999

This is good for an internal network or to quickly analyse a host.

docker run -d --name=netdata \
  -p 19999:19999 \
  -v /proc:/host/proc:ro \
  -v /sys:/host/sys:ro \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  --cap-add SYS_PTRACE \
  --security-opt apparmor=unconfined \
  netdata/netdata

The above can be converted to docker-compose file for ease of management:

version: '3'
services:
  netdata:
    image: netdata/netdata
    hostname: example.com # set to fqdn of host
    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

Docker container names resolution

If you want to have your container names resolved by netdata it needs to have access to docker group. To achive that just add environment variable PGID=999 to netdata container, where 999 is a docker group id from your host. This number can be found by running:

grep docker /etc/group | cut -d ':' -f 3

 

徐凤年

人于浮世,独来独往,独生独死,苦乐自当,无有代者。

留下你的评论

*评论支持代码高亮<pre class="prettyprint linenums">代码</pre>