Datadog Agent has some commands and only the lifecycle commands (i.e.
status on the Agent service) should be run with
sudo systemctl, all other commands need to be run with the
|Agent v5||Agent v6||Notes|
||Start Agent as a service|
||Stop Agent running as a service|
||Restart Agent running as a service|
||Status of Agent service|
||Status page of running Agent|
||Display command usage|
||Run a check|
More information about the metrics, events, and service checks for an integrations can be retrieved with the check command:
sudo service datadog-agent check [integration]
Add the check_rate argument to get the most recent values for rates:
sudo service datadog-agent check [integration] check_rate
service is not available on your system, use:
sudo start/stop/restart datadog-agent
sudo systemctl start/stop/restart datadog-agent
The configuration files and folders for the Agent are located at:
|Agent v5||Agent v6|
Configuration files for integrations:
|Agent v5||Agent v6|
Run the info or status command to see the state of the Agent.
The Agent logs are located in the
For Agent v5 logs are in:
If you’re still having trouble, our support team will be glad to provide further assistance.
A script is available to automatically install or upgrade the new Agent. It sets up the repos and installs the package for you; in case of upgrade, the import tool also searches for an existing
datadog.conf from a prior version and converts Agent and checks configurations according to the new file format and filesystem layout.
The Agent 6.x installer can automatically convert your 5.x style Agent configuration at upgrade:
DD_UPGRADE=true bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/datadog-agent/master/cmd/agent/install_script.sh)"
Note: the import process won’t automatically move custom Agent checks, this is by design since we cannot guarantee full backwards compatibility out of the box.
To install on a clean box (or have an existing Agent 5 install from which you do not wish to import the configuration) provide an api key:
DD_API_KEY=YOUR_API_KEY bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/datadog-agent/master/cmd/agent/install_script.sh)"
Set up Datadog’s Yum repo on your system by creating /etc/yum.repos.d/datadog.repo with the contents:
[datadog] name = Datadog, Inc. baseurl = https://yum.datadoghq.com/stable/6/x86_64/ enabled=1 gpgcheck=1 gpgkey=https://yum.datadoghq.com/DATADOG_RPM_KEY.public
Update your local yum repo and install the Agent:
sudo yum makecache sudo yum remove datadog-agent-base sudo yum install datadog-agent
Copy the example config into place and plug in your API key:
sudo sh -c "sed 's/api_key:.*/api_key: <YOUR_API_KEY>/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
Re-start the Agent on Centos 7 and above:
sudo systemctl restart datadog-agent.service
Re-start the Agent on Centos 6:
sudo initctl start datadog-agent
Remove the Agent 6 Yum repo from your system:
rm /etc/yum.repos.d/datadog.repo [ ! -f /etc/yum.repos.d/datadog.repo ] && echo -e '[datadog]\nname = Datadog, Inc.\nbaseurl = https://yum.datadoghq.com/rpm/x86_64/\nenabled=1\ngpgcheck=1\npriority=1\ngpgkey=https://yum.datadoghq.com/DATADOG_RPM_KEY.public\n https://yum.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public' | sudo tee /etc/yum.repos.d/datadog.repo
Update your local yum cache and downgrade the Agent
sudo yum clean expire-cache metadata sudo yum check-update sudo yum remove datadog-agent sudo yum install datadog-agent
Back-sync configurations and AutoDiscovery templates (optional): If you have made any changes to your configurations or templates, you might want to sync these back for Agent 5.
Note: please beware that if you have made any changes to your configurations to support new Agent v6-only options, these will not work anymore with Agent v5.
Back-sync custom Agent checks (optional) If you made any changes or added any new custom Agent checks while testing Agent 6 you might want to enable them back on Agent 5. Note: you only need to copy back checks you changed.
sudo -u dd-agent -- cp /etc/datadog-agent/checks.d/<check>.py /etc/dd-agent/checks.d/
Restart the Agent
# Systemd sudo systemctl restart datadog-agent # Upstart sudo /etc/init.d/datadog-agent restart
Clean out /etc/datadog-agent (optional)
sudo -u dd-agent -- rm -rf /etc/datadog-agent/
To uninstall the Agent, run:
``` $ sudo yum remove datadog-agent ```