Running a Docker environment? Our docker-scout container provides an instant monitoring environment for your host and containers.
Create a file called scoutd.yml (or copy our template.
account_key is required, all other values are optional. To get your account key, you need to be logged into your account, and go to the "Account Basics" section.
Here is a list of options currently available for scoutd.yml:
# account_key is the only required value account_key: hostname: display_name: log_file: ruby_path: environment: roles: agent_data_file: http_proxy: https_proxy: statsd: addr: 172.17.42.1:8125
Note: StatsD is enabled by default within in the Docker container. To disable StatsD, replace the
addr: 172.17.42.1:8125 line with
enabled: false and restart the scout container.
Create file "Dockerfile" from: https://github.com/pingdomserver/docker-scout/blob/master/Dockerfile
Go to the folder with the Dockerfile and run:
docker build -t scoutapp/docker-scout .
Note: scoutapp/docker-scout is a name of the docker image - you can change it.
Run the following command in the directory containing your
docker run -d --name scout-agent \ -v /proc:/host/proc:ro \ -v /etc/mtab:/host/etc/mtab:ro \ -v /var/run/docker.sock:/host/var/run/docker.sock:ro \ -v `pwd`/scoutd.yml:/etc/scout/scoutd.yml \ --net=host --privileged scoutapp/docker-scout
We want to look at resources on this host, not this container.
server_metrics Ruby gem used by the scout agent primarily looks at the
/proc directory, but, if available, will instead read from
/host/proc, which is expected to be mounted from the host when running the container (
-v /proc:/host/proc:ro in the above command sample).
server_metrics gem will also default to reading from
/host/etc/mtab (also mounted above), if it exists, to determine the drives mounted on the host. It will recognize theses hosts inside the container if they are mounted by UUID (
--net=host flag will allow gathering network metrics from the host.
--privileged flag will allow gathering the disk capacity metrics from the host.
Any option may be set in the provided scoutd.yml file. This file must be world-readable and mounted to
/etc/scout/scoutd.yml (see above command).
For a list of options, see scoutd.yml within
Monitor the resource usage of your running containers with our Docker Monitoring Plugin.
docker-scout includes a script that monitors Docker events (creating/starting/destroying/etc) and reports those metrics via StatsD. No extra dependencies are required.
Pingdom Server Monitor has many available publicly available plugins and supports Custom Plugins as well. Given this flexibility, the docker image may need to be customized to gain access to resources required by specific plugins.
Simply mount the file or directory from the
docker run --name=scout-webapp --volume=/var/log/some.log scoutapp/webapp docker run --name=scout-agent --volumes-from=scout-webapp scoutapp/docker-scout
If the plugin relies on a database connection (for example postgres), you will have to either download and update the docker-scout Dockerfile or create a new one that inherits from the docker-scout image, and install postgres as part of the build.
FROM scoutapp/docker-scout USER root RUN apt-get install -y postgresql-client libpq-dev RUN gem install pg USER scoutd # need to run the container under the scoutd user
The simplest way to link the containers is to specify a port. See the documentation on linking containers. For example:
docker run -d -p 5432:5432 postgres
Apply the appropriate settings to the plugin:
If the plugin requires the output of a command not available in the Pingdom server Monitor container and/or the information is not accessible over a port or through a mounted file, the setup might be more nuanced. Feel free to contact us at [email protected] for assistance.
Updated 4 months ago