Scripts agents are an easy way to add to Foglight out of the box monitoring capabilities and can be easily used to send counters from a Docker host to Foglight:
Step 1 - Find the commands that get the data.
The internet is full of examples for using Docker ps and docker images to get a lot of good counters from a Docker server.
docker ps -aq $1 | wc -l # get the number of all containers
docker ps -q $1 | wc -l # get the number of running containers
docker ps -a | grep -v -F 'Exited (0)' | grep -c -F 'Exited (' # get the number of crashed containers
docker images -aq $1 | wc -l # get the number of all images (including intermediate images)
docker images -q $1 | wc -l # get the number of images
docker images --filter "dangling=true" -q --no-trunc $1 | wc -l # get the number of dangling images
Step 2 - Send the result of the commands to standard output in a script agent.
Step 3 - Upload the script to Foglight, deploy the cartridge and create an agent.
The Process is well documented in our documentation, Videos, and articles.
The result is docker metrics in Foglight that can be used like any other Foglight metric.