Docker: Monitoring Docker with OpsDash

Quick Start

1. Install the OpsDash Smart Agent on the server (typically where Docker is running). If you need instructions for how to do this, here they are:  Debian/UbuntuCentOS/RHELGeneric.

2. Edit the OpsDash Smart Agent configuration file at /etc/opsdash/agent.cfg and add a new service:

# choose a good, unique name for the service (here my-docker-1 is used)
service "my-docker-1" {
    type = "docker"
    url = "unix:///var/run/docker.sock"
}

3. Reload the OpsDash Smart Agent so that it picks up the new configuration:

sudo service opsdash-agent reload

4. You should see the service my-docker-1 appear under https://app.opsdash.com/sources within a minute or so. Clicking on it should take you to the dashboard at https://app.opsdash.com/source/my-docker-1. If it does not, check the agent log file at /var/log/opsdash/agent.log.

Monitoring via the Docker Remote API

The Docker Remote API lets you connect to a Docker daemon running on another server via HTTP or HTTPS. OpsDash can collect metrics over this interface also. To use this, first enable the remote API in Docker (see Docker docs here). You can then use the HTTP (or HTTPS) url in the OpsDash configuration:

service "my-docker-2" {
    type = "docker"
    url = "http://10.2.0.10:2375/"
}

The "opsdash" User and the "docker" Group

The OpsDash Smart Agent runs as the Linux system user "opsdash". This user must be part of the "docker" group so that the metrics can be queried. If you installed the agent using the RPM or .deb package on a machine that already had docker, the setup already does this for you. If not, you need to add it manually, like this:

$ sudo gpasswd -a opsdash docker