Created
February 5, 2025 18:23
-
-
Save louy/dc79da1aeae9bb48f26e5fcd1879ad2b to your computer and use it in GitHub Desktop.
Datadog Agent Start/Stop Scripts
This file contains 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
export DD_API_KEY=XXXXX | |
export DD_ENV=`whoami`-local |
This file contains 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/sh | |
set -e | |
docker run --rm -d \ | |
--cgroupns host --pid host --name dd-agent \ | |
-v /var/run/docker.sock:/var/run/docker.sock:ro \ | |
-v /proc/:/host/proc/:ro \ | |
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \ | |
-e DD_API_KEY -e DD_ENV \ | |
-p 8125:8125/udp \ | |
-p 8126:8126/tcp \ | |
datadog/agent:7 |
This file contains 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/sh | |
docker stop dd-agent || true | |
docker rm dd-agent || true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment