Basic Agent Usage for macOS
Overview
This page outlines the basic features of the Datadog Agent for macOS. See the Supported Platforms documentation for the complete list of supported macOS distributions and versions.
Install the Agent
To install the Agent on macOS, follow the in-app instructions in Fleet Automation, and run the generated script on your hosts.
By default, the Agent is installed in a sandbox located at /opt/datadog-agent
. You can move this folder anywhere; however, this documentation assumes a default installation location.
Commands
The launchctl
service manager controls the Agent lifecycle, while other commands can be executed through the Agent binary, systray app, or web GUI.
Description | Command |
---|
Start Agent as a service | launchctl start com.datadoghq.agent or systray app |
Stop Agent running as a service | launchctl stop com.datadoghq.agent or systray app |
Restart Agent running as a service | Stop and then start the Agent with:
launchctl stop com.datadoghq.agent
launchctl start com.datadoghq.agent Or use the systray app |
Status of Agent service | launchctl list com.datadoghq.agent or systray app |
Status page of running Agent | datadog-agent status or web GUI |
Send flare | datadog-agent flare or web GUI |
Display command usage | datadog-agent --help |
Run a check | datadog-agent check <CHECK_NAME> |
Configuration
The Datadog Agent configuration file is located in /etc/datadog-agent/datadog.yaml
. This YAML file holds the host-wide connection details used to send data to Datadog including:
api_key
: your organization’s Datadog API keysite
: target Datadog region (for example datadoghq.com
, datadoghq.eu
, ddog-gov.com
)proxy
: HTTP/HTTPS proxy endpoints for outbound traffic (see Datadog Agent Proxy Configuration)- Default tags, log levels, and Datadog configurations.
A fully commented reference file, located in /etc/datadog-agent/datadog.yaml.example
, lists every available option for comparison or copy-paste. Alternatively, see the sample config_template.yaml file for all available configuration options.
Integration files
Configuration files for integrations are found in /etc/datadog-agent/conf.d/
. Each integration has its own sub-directory, <INTEGRATION>.d/
, which contains:
conf.yaml
: the active configuration controlling how the integration gathers metrics and logsconf.yaml.example
: a sample illustrating supported keys and defaults
Uninstall the Agent
To uninstall the Agent, run the following command:
Single user installation
To remove the Agent and all Agent configuration files:
- Stop and close the Datadog Agent with the bone icon in the tray.
- Drag the Datadog application from the application folder to the trash bin.
- Run the following commands:
sudo rm -rf /opt/datadog-agent
sudo rm -rf /usr/local/bin/datadog-agent
sudo rm -rf ~/.datadog-agent/** # to remove broken symlinks
launchctl remove com.datadoghq.agent
sudo rm -rf /var/log/datadog
- Reboot your machine for the changes to take effect.
Uninstall the Agent
To remove the Agent and all Agent configuration files:
- Drag the Datadog application from the application folder to the trash bin.
- To remove remaining files, run the following:
sudo rm -rf /opt/datadog-agent
sudo rm -rf /usr/local/bin/datadog-agent
sudo rm -rf ~/.datadog-agent/** # to remove broken symlinks
sudo launchctl disable system/com.datadoghq.agent && sudo launchctl bootout system/com.datadoghq.agent
sudo launchctl unload /Library/LaunchDaemons/com.datadoghq.agent.plist
sudo rm /Library/LaunchDaemons/com.datadoghq.agent.plist
sudo rm -rf /var/log/datadog
- Reboot your machine for the changes to take effect.
Troubleshooting
See the Agent Troubleshooting documentation for troubleshooting steps.
Working with the embedded Agent
The Agent contains an embedded Python environment at /opt/datadog-agent/embedded/
. Common binaries such as python
and pip
are contained within /opt/datadog-agent/embedded/bin/
.
See the instructions on how to add packages to the embedded Agent for more information.
Further Reading
Additional helpful documentation, links, and articles: