monitor host machine using metricbeat system module from inside a docker container

  docker, docker-compose, elasticsearch, kibana, metricbeat

i am using the docker compose to configure the system module of metric beat i have created the metricbeat.yml and system.yml and mount in my doker compose file

ex :- – /opt/prism/config/metricbeat/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml

but while restart the container i am getting an error of
Exiting: error initializing publisher: error initializing processors: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.22/containers/json?limit=0: dial unix /var/run/docker.sock: connect: permission denied
Exiting: error initializing publisher: error initializing processors: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.22/containers/json?limit=0: dial unix /var/run/docker.sock: connect: permission denied

Source: Docker Questions

LEAVE A COMMENT