Esta guía cubre la instalación del Agent 6. En Datadog se recomienda instalar o actualizar al Agent 7 para obtener las últimas funciones. Para obtener información sobre la instalación de la última versión del Agent, sigue las Instrucciones de instalación de la última versión del Agent . Para obtener información sobre la actualización al Agent 7 desde una versión anterior, consulta Actualización al Datadog Agent v7.
macOS
El Datadog Agent versión 6 requiere macOS 10.12 o superior.
El Agent 6.34 es la última versión compatible con macOS 10.12.
El Agent 6.38 es la última versión del Agent 6 para macOS.
Instalación del Agent
Línea de comandos
Ejecuta el siguiente comando, sustituyendo MY_API_KEY por tu clave de la API de Datadog:
El Agent se ejecuta al iniciar sesión. Puedes desactivarlo desde la bandeja del sistema.
LaunchDaemon
El Datadog Agent puede instalarse como LaunchDaemon en todo el sistema especificando DD_SYSTEMDAEMON_INSTALL=true y DD_SYSTEMDAEMON_USER_GROUP=username:groupname. Sustituye MY_API_KEY por tu clave de la API de Datadog:
El Agent se ejecuta al iniciarse el sistema. Se debe proporcionar un usuario no raíz válido y su grupo utilizando la variable DD_SYSTEMDAEMON_USER_GROUP. El proceso del Agent se ejecuta en este usuario y grupo.
La aplicación de la bandeja del sistema no es compatible con las instalaciones de LaunchDaemon en todo el sistema.
Añade la siguiente línea a /opt/datadog-agent/etc/datadog.yaml, sustituyendo MY_API_KEY por tu clave de la API de Datadog:
api_key: MY_API_KEY
sitio: datad0g.com
Administrar el Agent
Para administrar el Agent, utiliza:
la aplicación del Datadog Agent en la bandeja del sistema para una instalación de un solo usuario.
launchctl para instalar LaunchDaemon en todo el sistema.
el comando datadog-agent. El binario está en /usr/local/bin.
Activar o desactivar integraciones en /opt/datadog-agent/etc/conf.d.
Windows
A partir de la versión 6.11.0, el núcleo y los componentes APM/traza de Windows Agent se ejecutan en la cuenta ddagentuser y se crean en el momento de la instalación, en lugar de ejecutarse en la cuenta LOCAL_SYSTEM. Si estás actualizando desde una versión del Datadog Agent 6.x a 6.11 o superior, revisa la documentación del usuario de Windows Agent antes de realizar la actualización.
Los enlaces a todas las versiones disponibles del instalador de Windows están disponibles en formato JSON.
El comando de un solo paso instala los paquetes de APT para el Datadog Agent y te pide tu contraseña.
Si el Agent aún no está instalado en tu equipo y no deseas que se inicie automáticamente tras la instalación, añade DD_INSTALL_ONLY=true al comando antes de ejecutarlo.
Si dispones de un archivo de configuración actual del Agent, los valores actuales se conservarán durante la actualización.
Puedes configurar algunas de las opciones del Agent durante el proceso de instalación inicial. Para obtener más información, check el las opciones de configuración install_script.
Para instalar el Agent, ejecuta el siguiente comando, sustituyendo MY_API_KEY por tu clave de la API de Datadog:
Si no vas a actualizar y no deseas utilizar una configuración antigua, copia la configuración de ejemplo e instala el Agent. Sustituye MY_API_KEY por tu clave de la API de Datadog:
sudo sh -c "sed 's/api_key:.*/api_key: MY_API_KEY/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
Configurar la región de Datadog:
sudo sh -c "sed -i 's/# site:.*/site: datad0g.com/'
/etc/datadog-agent/datadog.yaml"
Asegúrate de que los permisos del usuario del Agent sean correctos::
sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 640 /etc/datadog-agent/datadog.yaml"
Inicia el Agent:
sudo systemctl restart datadog-agent.service
Instalación en un solo paso
El comando de un solo paso instala los paquetes de APT para el Datadog Agent y te pide la contraseña. Si el Agent aún no está instalado en el equipo y no quieres que se inicie automáticamente después de la instalación, añade DD_INSTALL_ONLY=true al principio del comando antes de ejecutarlo.
Ejecuta el siguiente comando, sustituyendo MY_API_KEY por tu clave de la API de Datadog:
Si no vas a actualizar y no deseas utilizar una configuración antigua, copia la configuración de ejemplo e instala el Agent. Sustituye MY_API_KEY por tu clave de la API de Datadog:
sudo sh -c "sed 's/api_key:.*/api_key: MY_API_KEY/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
Configura la región de Datadog:
sudo sh -c "sed -i 's/# site:.*/site: datad0g.com/' /etc/datadog-agent/datadog.yaml"
Asegúrate de que los permisos del usuario del Agent sean correctos::
sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 640 /etc/datadog-agent/datadog.yaml"
Inicia el Agent:
Ubuntu 16.04 y superiores:
sudo systemctl restart datadog-agent.service
Ubuntu 14.04:
sudo initctl start datadog-agent
Instalación en un solo paso
El comando de un solo paso instala los paquetes de YUM para el Datadog Agent y te pide la contraseña.
Si el Agent aún no está instalado en tu máquina y no deseas que se inicie automáticamente tras la instalación, añade DD_INSTALL_ONLY=true al comando antes de ejecutarlo.
Si dispones de un archivo de la configuración actual del Agent, los valores actuales se conservarán durante la actualización.
Puedes configurar algunas de las opciones del Agent durante el proceso la instalación inicial. Para obtener más información, check las opciones de configuración install_script.
Ejecuta el siguiente comando, sustituyendo MY_API_KEY por tu clave de la API de Datadog:
If you’re not upgrading and do not want to use an old configuration, copy the example config into place and install the Agent. Replace MY_API_KEY with your Datadog API key:
sudo sh -c "sed 's/api_key:.*/api_key: MY_API_KEY/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
Configure the Datadog region:
sudo sh -c "sed -i 's/# site:.*/site: datad0g.com/' /etc/datadog-agent/datadog.yaml"
Ensure the Agent user’s permissions are correct::
sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 640 /etc/datadog-agent/datadog.yaml"
Start the Agent:
Amazon Linux 2.0:
sudo systemctl restart datadog-agent.service
Amazon Linux 1.0:
sudo initctl start datadog-agent
One-step install
The one-step command installs the YUM packages for the Datadog Agent and prompts you for your password.
If the Agent is not already installed on your machine and you don’t want it to start automatically after the installation, prepend DD_INSTALL_ONLY=true to the command before running it.
If you have an existing Agent configuration file, existing values are retained during the update.
You can configure some of the Agent options during the initial install process. For more information, check the install_script configuration options.
Run the following command, replacing MY_API_KEY with your Datadog API key:
If you’re not upgrading and do not want to use an old configuration, copy the example config into place and install the Agent. Replace MY_API_KEY with your Datadog API key:
sudo sh -c "sudo sh -c "sed 's/api_key:.*/api_key: .*/api_key: MY_API_KEY/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
Configure the Datadog region:
sudo sh -c "sed -i 's/# site:.*/site: datad0g.com/' /etc/datadog-agent/datadog.yaml"
Ensure the Agent user’s permissions are correct::
sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 640 /etc/datadog-agent/datadog.yaml"
Start the Agent:
Centos or Red Hat 7 and higher:
sudo systemctl restart datadog-agent.service
Centos or Red Hat 6:
sudo initctl start datadog-agent
One-step install
The one-step command installs the YUM packages for the Datadog Agent and prompts you for your password.
If the Agent is not already installed on your machine and you don’t want it to start automatically after the installation, prepend DD_INSTALL_ONLY=true to the command before running it.
If you have an existing Agent configuration file, existing values are retained during the update.
You can configure some of the Agent options during the initial install process. For more information, check the install_script configuration options.
Run the following command, replacing MY_API_KEY with your Datadog API key:
If you’re not upgrading and do not want to use an old configuration, copy the example config into place and install the Agent. Replace MY_API_KEY with your Datadog API key:
sudo sh -c "sudo sh -c "sed 's/api_key:.*/api_key: .*/api_key: MY_API_KEY/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
Configure the Datadog region:
sudo sh -c "sed -i 's/# site:.*/site: datad0g.com/' /etc/datadog-agent/datadog.yaml"
Ensure the Agent user’s permissions are correct::
sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 640 /etc/datadog-agent/datadog.yaml"
Restart the Agent:
sudo systemctl restart datadog-agent.service
One-step install
The one-step command installs the YUM packages for the Datadog Agent and prompts you for your password.
If the Agent is not already installed on your machine and you don’t want it to start automatically after the installation, prepend DD_INSTALL_ONLY=true to the command before running it.
If you have an existing Agent configuration file, existing values are retained during the update.
You can configure some of the Agent options during the initial install process. For more information, check the install_script configuration options.
Run the following command, replacing MY_API_KEY with your Datadog API key:
If you’re not upgrading and do not want to use an old configuration, copy the example config into place and install the Agent. Replace MY_API_KEY with your Datadog API key:
sudo sh -c "sudo sh -c "sed 's/api_key:.*/api_key: .*/api_key: MY_API_KEY/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
Configure the Datadog region:
sudo sh -c "sed -i 's/# site:.*/site: datad0g.com/' /etc/datadog-agent/datadog.yaml"
Ensure the Agent user’s permissions are correct::
sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 640 /etc/datadog-agent/datadog.yaml"
Restart the Agent:
sudo systemctl restart datadog-agent.service
One-step install
The one-step command installs the YUM packages for the Datadog Agent and prompts you for your password.
If the Agent is not already installed on your machine and you don’t want it to start automatically after the installation, prepend DD_INSTALL_ONLY=true to the command before running it.
If you have an existing Agent configuration file, existing values are retained during the update.
You can configure some of the Agent options during the initial install process. For more information, check the install_script configuration options.
Run the following command, replacing MY_API_KEY with your Datadog API key:
Si no vas a actualizar y no deseas utilizar una configuración antigua, copia la configuración de ejemplo e instala el Agent. Sustituye MY_API_KEY por tu clave de la API de Datadog:
sudo sh -c "sudo sh -c "sed 's/api_key:.*/api_key: .*/api_key: MY_API_KEY/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
Configurar la región de Datadog:
sudo sh -c "sed -i 's/# site:.*/site: datad0g.com/' /etc/datadog-agent/datadog.yaml"
Asegúrate de que los permisos del usuario del Agent sean correctos::
sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 640 /etc/datadog-agent/datadog.yaml"
Restart the Agent:
sudo systemctl restart datadog-agent.service
Instalación en un solo paso
The one-step command installs the latest BFF package for the Datadog Agent and prompts you for your password if necessary. Si el Agent aún no está instalado en su equipo y no deseas que se inicie automáticamente tras la instalación, añade DD_INSTALL_ONLY=true al comando antes de ejecutarlo.
Ejecuta el siguiente comando, sustituyendo MY_API_KEY por tu clave de la API de Datadog:
Ensure that the Datadog Agent has the correct permissions:
sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 660 /etc/datadog-agent/datadog.yaml"
Stop the Agent service:
sudo stopsrc -s datadog-agent
Verify the Agent service has stopped:
sudo lssrc -s datadog-agent
Restart the Agent service:
sudo startsrc -s datadog-agent
Cloud and containers
Run the Datadog Agent directly in your Kubernetes cluster to start collecting your cluster and applications metrics, traces, and logs. You can deploy the Agent with a Helm chart, the Datadog Operator or directly with a DaemonSet. For more information about installing the Datadog Agent on different distributions, see the Kubernetes distributions documentation.
Installing the Datadog Agent
To install the chart with a custom release name RELEASE_NAME:
This chart adds the Datadog Agent to all nodes in your cluster using a DaemonSet. Soon after installation, Datadog begins to report hosts and metrics data in your account.
Enabling log collection
To enable log collection with Helm, update your datadog-values.yaml file with the following log collection configuration:
The one-step installation command runs a signed Docker container which embeds the Datadog Agent to monitor your host. The Docker integration is enabled by default, as well as Autodiscovery in automatic configuration mode.
You must not run more than one Datadog Agent per node. Running multiple Agents may result in unexpected behavior.
For a one-step install, run the following command. Replace MY_API_KEY with your Datadog API key:
If the one-step installation command does not work, it’s possible that your system mounts the cgroup directory in an unexpected place or does not use CGroups for memory management. CGroups are required for the Docker check to succeed. To enable CGroups, see the Setup documentation.
If CGroups are enabled, but the check is failing because of an unexpected cgroup directory location:
Run mount | grep "cgroup type tmpfs" to retrieve the location of the cgroup directory.
Replace the first occurence of /sys/fs/cgroup in the one-step installation command with the location of the cgroup directory.
Send custom metrics with DogStatsD
By default, DogStatsD only listens to localhost. To listen to DogStatsD packets from other containers:
Add -e DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true to the container’s parameters.
Bind the container’s statsd port to the hosts’s IP by adding the -p 8125:8125/udp option to the container’s parameters.
Configure your client library to send UDP packets to the hosts’s IP.
Running CoreOS Container Linux is supported with the Docker runtime. For installation instructions, see Docker.
To run CoreOS Tectonic on Kubernetes, see Kubernetes.
Starting with version 6.1, the Datadog Agent supports monitoring OpenShift Origin and Enterprise clusters. Depending on your needs and the security constraints of your cluster, three deployment scenarios are supported:
The Datadog Agent BOSH release only works on Ubuntu and Red Hat stemcells.
Upload the Datadog Agent release to your BOSH Director:
# BOSH CLI v1bosh upload release https://cloudfoundry.datadoghq.com/datadog-agent/datadog-agent-boshrelease-latest.tgz
# BOSH CLI v2bosh upload-release https://cloudfoundry.datadoghq.com/datadog-agent/datadog-agent-boshrelease-latest.tgz
Configure Datadog as an addon in your runtime config. Replace MY_API_KEY with your Datadog API key::
# runtime.yml---releases:- name:datadog-agentversion:$UPLOADED_VERSION# e.g. 1.0.5140addons:- name:datadogjobs:- name:dd-agentrelease:datadog-agentproperties:dd:use_dogstatsd:yesdogstatsd_port:18125# Many Cloud Foundry deployments have their own StatsD listening on port 8125api_key:MY_API_KEYtags:["my-cloud-foundry-deployment"]# optional. Add any tags you wish# Optionally, enable any Agent Checks here# integrations:# directory:# init_config: {}# instances:# directory: "."
Install the Datadog Ansible collection from Ansible Galaxy on your Ansible server:
ansible-galaxy collection install datadog.dd
The Datadog Ansible collection is also available through the Red Hat Automation Hub where it is officially certified by Red Hat.
Installing the collection is recommended. If needed, you can also install Datadog using the standalone role.
To deploy the Datadog Agent on hosts, add the Datadog role and your API key to your playbook. Replace MY_API_KEY with your Datadog API key:
- hosts:serverstasks:- name:Import the Datadog Agent role from the Datadog collectionimport_role:name:datadog.dd.agentvars:datadog_api_key:"MY_API_KEY"datadog_agent_major_version:6datadog_site:"datad0g.com"
To ensure that the Agent can group your hosts together, only use node hostnames that the Datadog Agent is tracking. You can check what hostnames the Agent is tracking using the following command:
sudo datadog-agent status
Specific Agent checks
To use a specific Agent check or integration on one of your nodes, you can use the datadog_checks variable. Here is an example for the process check:
- hosts:serverstasks:- name:Import the Datadog Agent role from the Datadog collectionimport_role:name:datadog.dd.agentvars:datadog_api_key:"MY_API_KEY"datadog_agent_major_version:6datadog_site:"datad0g.com"datadog_checks:process:init_config:instances:- name:sshsearch_string:['ssh','sshd']- name:syslogsearch_string:['rsyslog']cpu_check_interval:0.2exact_match:trueignore_denied_access:true
You can find more examples of the Agent role usage on the GitHub repo for the standalone role.
Metrics and events
To get metrics and events on Datadog after Ansible runs, see the Ansible callback project’s GitHub page.
Starting with version 2.9.0, the datadog_agent module supports both Windows and Linux nodes. Previous versions of the datadog_agent module only support Linux nodes.
Requirements:
Requires Puppet Open Source version >= 4.6 or Puppet Enterprise version >= 2016.4
Install the Agent
Install the datadog_agent module from the Puppet Forge on your Puppet server:
For fresh installs, run the module install command:
puppet module install datadog-datadog_agent
If the module is already installed, upgrade it:
puppet module upgrade datadog-datadog_agent
To deploy the Datadog Agent on nodes, add this parametrized class to your manifests. Replace MY_API_KEY with your Datadog API key:
To ensure that the Agent can group your hosts together, only use node hostnames that the Datadog Agent is tracking. You can check what hostnames the Agent is tracking using the following command:
sudo datadog-agent status
Enable reporting to Datadog on your Puppet server:
Add the following parameters to /etc/puppet/puppet.conf:
Run Puppet on your Puppet server to install all necessary dependencies.
Restart your Puppet server to begin receiving Puppet data in Datadog.
Specific Agent checks
To use a specific Agent check or integration on one of your nodes, see the relevant integration manifest for a code sample. Here is an example for the elasticsearch integration:
If you are using Berkshelf, add the cookbook to your Berksfile:
cookbook 'datadog', '~> 4.0'
If you’re not using Berkshelf, install the cookbook in to your repository using Knife:
knife cookbook site install datadog
Set the Datadog-specific attributes in either a role, environment, or another recipe. Replace MY_API_KEY with your Datadog API key:
node.default['datadog']['api_key'] = "MY_API_KEY"
# Use an existing application key or create a new one for Chef
node.default['datadog']['application_key'] = "Generate Application Key"
# Enable install for Agent version 6
node.default['datadog']['agent_major_version'] = 6
# Set the Datadog site
node.default['datadog']['site'] = "datad0g.com"
The Datadog Saltstack formula only supports Debian-based and RedHat-based systems.
The following instructions add the Datadog formula to the base Salt environment. To add it to another Salt environment, replace references to base with the name of your Salt environment.
Install using gitfs_remotes
Install the Datadog formula in the base environment of your Salt Master node, using the gitfs_remotes option in your Salt Master configuration file (by default /etc/salt/master):
fileserver_backend:- roots# Active by default, necessary to be able to use the local salt files we define in the next steps- gitfs# Adds gitfs as a fileserver backend to be able to use gitfs_remotesgitfs_remotes:- https://github.com/DataDog/datadog-formula.git:- saltenv:- base:- ref:3.0# Pin here the version of the formula you want to use