Skip to content

Instantly share code, notes, and snippets.

@LotharSee
LotharSee / Procedure.md
Last active August 29, 2015 14:14
Non-root Datadog Agent supervisor on CentOS

Procedure to make the Datadog Agent Supervisor run as dd-agent instead of root. The main issue is file permission. I moved lock, pid and sock to /tmp to ensure it works well. Any other directory with rw permission for the user dd-agent would make it.

  • Stop the Agent. service datadog-agent stop
  • Be sure that all processes are stopped and the pid/sock got removed
    • Check ps aux | grep -v grep | grep datadog should be empty
    • Remove /var/run/datadog-supervisord.pid, /var/tmp/datadog-supervisor.sock, /var/lock/subsys/datadog-agent.
  • Give permission to dd-agent to the supervisor log file.
    • Run chown dd-agent:dd-agent /var/log/datadog/supervisord.log
  • Update the init script and the supervisor configuration to put files in tmp.
@LotharSee
LotharSee / Docker commands
Last active May 21, 2020 13:25
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.
@LotharSee
LotharSee / docker.yaml
Created November 6, 2014 15:53
Docker configuration example with max_containers raised to 1000
# Warning
# The user running the Datadog Agent (usually "dd-agent") must be part of the "docker" group
init_config:
# Change the root directory to look at to get cgroup statistics. Useful when running inside a
# container with host directories mounted on a different folder. Default: /.
#
# docker_root: /host
instances:
@LotharSee
LotharSee / bench-runner.py
Created July 29, 2014 00:08
redis-py benchmark
results = {}
(1..10).each do
['2.4.13', '2.9.1', '2.10.1', 'master'].each do |v|
results[v] ||= {}
['10', '50','100', '500', '1000', '5000', '10000', '50000', '100000'].each do |s|
`git checkout #{v}`
results[v][s] ||= 0
results[v][s] += `python main-bench.py #{s}`.to_f
puts v
@LotharSee
LotharSee / Dockerfile
Created June 7, 2014 00:07
Datadog Agent Dockerfile simple example
FROM datadog/docker-dd-agent
# Set your API key
RUN sed -i -e"s/^.*api_key:.*$/api_key: EXAMPLE_API_KEY/" /etc/dd-agent/datadog.conf
@LotharSee
LotharSee / Dockerfile
Created June 6, 2014 20:55
Datadog Agent Dockerfile example, integrating Apache
FROM datadog/docker-dd-agent
# Set your API key
RUN sed -i -e"s/^.*api_key:.*$/api_key: EXAMPLE_API_KEY/" /etc/dd-agent/datadog.conf
# Add Apache check configuration
ADD apache.yaml /etc/dd-agent/conf.d/apache.yaml
@LotharSee
LotharSee / Dockerfile
Last active March 13, 2019 00:14
DogStatsD Dockerfile
FROM datadog/docker-dogstatsd
# Set your API key
RUN sed -i -e"s/^.*api_key:.*$/api_key: EXAMPLE_API_KEY/" /etc/dd-agent/datadog.conf
@LotharSee
LotharSee / gist:5671593
Created May 29, 2013 16:22
BadStatusLine error on FreeBSD. Output of source install on FreeBSD 9.1, with last version of ports.
# cat /root/.datadog-agent/ddagent-install.log
Creating log file /root/.datadog-agent/ddagent-install.log.....Done
Operating System: FreeBSD
Setting up virtual environment..... % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 112k 100 112k 0 0 94728 0 0:00:01 0:00:01 --:--:-- 99k
New python executable in /root/.datadog-agent/venv/bin/python
Installing setuptools............................done.
Installing pip...................done.
Done