Last active
May 21, 2020 13:25
-
-
Save LotharSee/a899393a7231ecfb39af to your computer and use it in GitHub Desktop.
Datadog Agent check of Varnish running inside a container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run a Varnish container to test this | |
# I had to hack TERM=xterm otherwise "varnishstat" would not work | |
docker run -d -P -h "my_varnish" --name "my_varnish_container" -e TERM=xterm vbatts/fedora-varnish | |
# "my_varnish_container" is used as container name in docker_varnishstat. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Be sure this file is executable and located in /opt/docker_varnishstat | |
/usr/bin/docker exec my_varnish_container varnishstat "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init_config: | |
instances: | |
- varnishstat: /opt/docker_varnishstat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd just like to admit that wrapper script (
docker_varnishstat
) needs to be accessible and executable. Without that DD Agent fails the check silently (no output, no error, exit code 0).