Skip to content

Instantly share code, notes, and snippets.

@LotharSee
Last active May 21, 2020 13:25
Show Gist options
  • Save LotharSee/a899393a7231ecfb39af to your computer and use it in GitHub Desktop.
Save LotharSee/a899393a7231ecfb39af to your computer and use it in GitHub Desktop.
Datadog Agent check of Varnish running inside a container
# 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.
#!/bin/bash
# Be sure this file is executable and located in /opt/docker_varnishstat
/usr/bin/docker exec my_varnish_container varnishstat "$@"
init_config:
instances:
- varnishstat: /opt/docker_varnishstat
@lukaszjankowski
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment