Docker Plugin issues with 1.3 Telegraf

telegraf
#1

I have two problems that I am facing with the docker plugin for telegraf 1.3.

Running telegraf as the telegraf user I get:

Aug 29 12:24:20 lxv5224 telegraf: 2017-08-29T17:24:20Z E! Error in plugin [inputs.docker]: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker/libcontainerd/docker-containerd.sock: Get http://%2Fvar%2Frun%2Fdocker%2Flibcontainerd%2Fdocker-containerd.sock/containers/json?limit=0: dial unix /var/run/docker/libcontainerd/docker-containerd.sock: connect: permission denied

sudo -u telegraf telegraf -config /etc/telegraf/telegraf.conf -input-filter docker -test

  • Plugin: inputs.docker, Collection 1
    2017-08-29T17:34:29Z E! Error in plugin [inputs.docker]: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker/libcontainerd/docker-containerd.sock: Get http://%2Fvar%2Frun%2Fdocker%2Flibcontainerd%2Fdocker-containerd.sock/info: dial unix /var/run/docker/libcontainerd/docker-containerd.sock: connect: permission denied
    2017-08-29T17:34:29Z E! Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker/libcontainerd/docker-containerd.sock: Get http://%2Fvar%2Frun%2Fdocker%2Flibcontainerd%2Fdocker-containerd.sock/containers/json?limit=0: dial unix /var/run/docker/libcontainerd/docker-containerd.sock: connect: permission denied

we have modified the permissions on the socks file to all telegraf access
ls -lrt /var/run/docker/libcontainerd/docker-containerd.sock
srw-rw----. 1 root root 0 Aug 29 12:16 /var/run/docker/libcontainerd/docker-containerd.sock

2nd Issue, when running telegraf as root.

Aug 29 12:22:00 lxv5224 telegraf: * Are you trying to connect to a TLS-enabled daemon without TLS?
Aug 29 12:22:00 lxv5224 telegraf: 2017-08-29T17:22:00Z E! Error in plugin [inputs.docker]: Get http://%2Fvar%2Frun%2Fdocker%2Flibcontainerd%2Fdocker-containerd.sock/containers/json?limit=0: malformed HTTP response “\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x04\b\x00\x00\x00\x00\x00\x00\x0e\xff\xf1”.

telegraf -config /etc/telegraf/telegraf.conf -input-filter docker -test

  • Plugin: inputs.docker, Collection 1
    2017-08-29T17:34:50Z E! Error in plugin [inputs.docker]: Get http://%2Fvar%2Frun%2Fdocker%2Flibcontainerd%2Fdocker-containerd.sock/info: malformed HTTP response “\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x04\b\x00\x00\x00\x00\x00\x00\x0e\xff\xf1”.
  • Are you trying to connect to a TLS-enabled daemon without TLS?
    2017-08-29T17:34:50Z E! Get http://%2Fvar%2Frun%2Fdocker%2Flibcontainerd%2Fdocker-containerd.sock/containers/json?limit=0: malformed HTTP response “\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x04\b\x00\x00\x00\x00\x00\x00\x0e\xff\xf1”.
  • Are you trying to connect to a TLS-enabled daemon without TLS?
    root@lxv5224 [~] #
#2

I recommend adding the telegraf user to the docker group and not modifying the permissions of the socket. Try following these postinstall steps.

Regarding your second question, are you using TLS with the docker socket?

#3

thanks for your help Daniel, issue has been resolved. it was related to the users groups and pointing to the incorrect socks location.

#4

I have a similar error please see Telegraf - docker-containerd

tks