Network Performance Monitoring is now generally available! Network Monitoring is now available!

Basic Agent Usage for Windows

Setup

If you haven’t installed the Datadog Agent yet, see below or the in-app installation instructions. See the Agent documentation for supported OS versions.

Installation

Starting with Agent v6.11.0, the core and APM/trace components of the Windows Agent run under the ddagentuser account created at install time instead of the LOCAL_SYSTEM account. The Live Process component, if enabled, runs under the LOCAL_SYSTEM account. Learn more about the Datadog Windows Agent User.

Note: There are special considerations for domain controllers.

GUI

  1. Download the Datadog Agent installer.
  2. Run the installer (as Administrator) by opening ddagent-cli-6.14.2.msi.
  3. Follow the prompts, accept the license agreement, and enter your Datadog API key.
  4. When the install finishes, you are given the option to launch the Datadog Agent Manager.

Command line

Optionally, install the Agent with the command line to add custom settings.

  1. Download the Datadog Agent installer.
  2. Run one of the following commands inside the directory where you downloaded the installer.
    Note: The /qn option runs a quiet install. To see the GUI prompts, remove it.

Command prompt:

start /wait msiexec /qn /i ddagent-cli-6.14.2.msi APIKEY="<YOUR_DATADOG_API_KEY>"

Powershell:

Start-Process -Wait msiexec -ArgumentList '/qn /i ddagent-cli-6.14.2.msi APIKEY="<YOUR_DATADOG_API_KEY>"'

Each configuration item is added as a property to the command line. The following configuration command line options are available when installing the Agent on Windows:

VariableTypeDescription
APIKEYStringAdds the Datadog API KEY to the configuration file.
TAGSStringComma-separated list of tags to assign in the configuration file. Example: TAGS="key_1:val_1,key_2:val_2"
HOSTNAMEStringConfigures the hostname reported by the Agent to Datadog (overrides any hostname calculated at runtime).
LOGS_ENABLEDStringEnable ("true") or disable ("false") the log collection feature in the configuration file. Logs are disabled by default.
APM_ENABLEDStringEnable ("true") or disable ("false") the APM Agent in the configuration file. APM is enabled by default.
PROCESS_ENABLEDStringEnable ("true") or disable ("false") the Process Agent in the configuration file. The Process Agent is disabled by default.
CMD_PORTNumberA valid port number between 0 and 65534. The Datadog Agent exposes a command API on port 5001. If that port is already in use by another program, the default may be overridden here.
PROXY_HOSTStringIf using a proxy, sets your proxy host. Learn more about using a proxy with the Datadog Agent.
PROXY_PORTNumberIf using a proxy, sets your proxy port. Learn more about using a proxy with the Datadog Agent.
PROXY_USERStringIf using a proxy, sets your proxy user. Learn more about using a proxy with the Datadog Agent.
PROXY_PASSWORDStringIf using a proxy, sets your proxy password. For the process/container Agent, this variable is required for passing in an authentication password and cannot be renamed. Learn more about using a proxy with the Datadog Agent.
DDAGENTUSER_NAMEStringOverride the default ddagentuser username used during Agent installation (v6.11.0+). Learn more about the Datadog Windows Agent User.
DDAGENTUSER_PASSWORDStringOverride the cryptographically secure password generated for the ddagentuser user during Agent installation (v6.11.0+). Must be provided for installs on domain servers. Learn more about the Datadog Windows Agent User.
APPLICATIONDATADIRECTORYPathOverride the directory to use for the configuration file directory tree. May only be provided on initial install; not valid for upgrades. Default: C:\ProgramData\Datadog. (v6.11.0+)
PROJECTLOCATIONPathOverride the directory to use for the binary file directory tree. May only be provided on initial install; not valid for upgrades. Default: %PROGRAMFILES%\Datadog\Datadog Agent. (v6.11.0+)

Note: If a valid datadog.yaml is found and has an API key configured, that file takes precedence over all specified command line options.

Validation

To verify your installation, follow the instructions in the Agent Status and Information section.

Agent Commands

The execution of the Agent is controlled by the Windows Service Control Manager.

  • The main executable name is agent.exe.
  • The configuration GUI is a browser-based configuration application (for Windows 64-bit only).
  • Commands can be run from the command line "%PROGRAMFILES%\Datadog\Datadog Agent\bin\agent.exe" <command> for Agent versions >= 6.12 or "%PROGRAMFILES%\Datadog\Datadog Agent\embedded\agent.exe" <command> for Agent versions <= 6.11. Command-line options are below:
CommandDescription
checkRuns the specified check.
diagnoseExecutes some connectivity diagnosis on your system.
flareCollects a flare and send it to Datadog.
helpGets help about any command.
hostnamePrints the hostname used by the Agent.
importImports and converts configuration files from previous versions of the Agent.
installserviceInstalls the Agent within the service control manager.
launch-guiStarts the Datadog Agent Manager.
regimportImport the registry settings into datadog.yaml.
remove-serviceRemoves the Agent from the service control manager.
restart-serviceRestarts the Agent within the service control manager.
runStarts the Agent.
startStarts the Agent. (Being deprecated, but accepted. Use run as an alternative.)
start-serviceStarts the Agent within the service control manager.
statusPrint the current status.
stopserviceStops the Agent within the service control manager.
versionPrints the version info.

Use the Datadog Agent Manager (available from the start menu).

Use the start, stop, and restart commands in the Datadog Agent Manager:

You can also use Windows Powershell, where available: [start|stop|restart]-service datadogagent

Configuration

Use the Datadog Agent Manager to enable, disable, and configure checks. Restart the Agent for your changes to be applied.

The main Agent configuration file is located at:
C:\ProgramData\Datadog\datadog.yaml

Configuration files for integrations are in:
C:\ProgramData\Datadog\conf.d\ OR
C:\Documents and Settings\All Users\Application Data\Datadog\conf.d\

Note: ProgramData is a hidden folder.

The main Agent configuration file is located at:
C:\ProgramData\Datadog\datadog.conf

Configuration files for integrations are in:
C:\ProgramData\Datadog\conf.d\ OR
C:\Documents and Settings\All Users\Application Data\Datadog\conf.d\

Note: ProgramData is a hidden folder.

Troubleshooting

Agent Status and Information

To verify the Agent is running, check if the DatadogAgent service in the Services panel is listed as Started. A process called Datadog Metrics Agent (agent.exe) should also exist in the Task Manager.

To receive more information about the Agent’s state, start the Datadog Agent Manager:

  • Right click on the Datadog Agent system tray icon -> Configure, or
  • Run & "%PROGRAMFILES%\Datadog\Datadog Agent\bin\agent.exe" launch-gui for agent version >= 6.12 or & "%PROGRAMFILES%\Datadog\Datadog Agent\embedded\agent.exe" launch-gui for agent version <= 6.11 from an admin Powershell prompt

Then, open the status page by going to Status -> General. Get more information on running checks in Status -> Collector and Checks -> Summary.

The status command is available for Powershell:

& "%PROGRAMFILES%\Datadog\Datadog Agent\embedded\agent.exe" status

or cmd.exe:

"%PROGRAMFILES%\Datadog\Datadog Agent\embedded\agent.exe" status

To verify the Agent is running, check if the service status in the Services panel is listed as “Started”. A process called ddagent.exe should also exist in the Task Manager.

Information about the Agent’s state for Agent v5.2+ is available in the Datadog Agent Manager -> Settings -> Agent Status:

For the status of Agent v3.9.1 to v5.1, navigate to http://localhost:17125/status.

The info command is available for Powershell:

& "%PROGRAMFILES%\Datadog\Datadog Agent\embedded<PYTHON_MAJOR_VERSION>\python.exe" "%PROGRAMFILES%\Datadog\Datadog Agent\agent\agent.py" info

or cmd.exe:

"%PROGRAMFILES%\Datadog\Datadog Agent\embedded<PYTHON_MAJOR_VERSION>\python.exe" "%PROGRAMFILES%\Datadog\Datadog Agent\agent\agent.py" info

Note: For Agent versions <= 6.11 the path should be %PROGRAMFILES%\Datadog\Datadog Agent\embedded\python.exe instead.

Logs location

The Agent logs are located in C:\ProgramData\Datadog\logs\agent.log.

Note: ProgramData is a hidden folder.

Need help? Contact Datadog support.

For Windows Server 2008, Vista, and newer systems, the Agent logs are located in C:\ProgramData\Datadog\logs.

Note: ProgramData is a hidden folder.

Need help? Contact Datadog support.

Send a flare

  • Navigate to http://127.0.0.1:5002 to display the Datadog Agent Manager.

  • Select flare tab.

  • Enter your ticket number (if you have one).

  • Enter the email address you use to log in to Datadog.

  • Press Submit.

To send Datadog support a copy of your Windows logs and configurations, do the following:

  • Open the Datadog Agent Manager.

  • Select Actions.

  • Select Flare.

  • Enter your ticket number (if you don’t have one, leave the value as zero).

  • Enter the email address you use to log in to Datadog.

The flare command is available for Powershell:

& "%PROGRAMFILES%\Datadog\Datadog Agent\embedded\python.exe" "%PROGRAMFILES%\Datadog\Datadog Agent\agent\agent.py" flare <CASE_ID>

or cmd.exe:

"%PROGRAMFILES%\Datadog\Datadog Agent\embedded\python.exe" "%PROGRAMFILES%\Datadog\Datadog Agent\agent\agent.py" flare <CASE_ID>

Flare fails to upload

On Linux and macOS, the output of the flare command tells you where the compressed flare archive is saved. In case the file fails to upload to Datadog, you can retrieve it from this directory and manually add as an attachment to an email.

For Windows, you can find the location of this file by running the following from the Agent’s Python command prompt:

Step 1:

  • Agent v5.12+: "%PROGRAMFILES%\Datadog\Datadog Agent\dist\shell.exe" since

  • Older Agent versions: "%PROGRAMFILES%\Datadog\Datadog Agent\files\shell.exe"

Step 2:

import tempfile
print tempfile.gettempdir()

Example:

Use Cases

Monitoring a Windows Service

On your target host, launch the Datadog Agent Manager and select the “Windows Service” Integration from the list. For this, there is an out-of-the-box example; however, this example uses DHCP.

To get the name of the service, open services.msc and locate your target service. Using DHCP as the target, you can see the service name at the top of the service properties window:

When adding your own services, be sure to follow the formatting exactly as shown. If formatting is not correct the integration fails.

Also, whenever you modify an integration, the Datadog service needs to be restarted. You can do this from services.msc or from the UI sidebar.

For Services, Datadog doesn’t track the metrics—only their availability. (For metrics, use the Process or WMI integration). To set up a Monitor, select the Integration monitor type then search for Windows Service. From Integration Status -> Pick Monitor Scope, choose the service you would like to monitor.

Monitoring system load for Windows

The Datadog Agent collects a large number of system metrics out of the box. One of the more commonly used system metrics is system.load.*.

MetricDescription
system.load.1 (gauge)The average system load over one minute.
system.load.15 (gauge)The average system load over fifteen minutes.
system.load.5 (gauge)The average system load over five minutes.
system.load.norm.1 (gauge)The average system load over one minute normalized by the number of CPUs.
system.load.norm.15 (gauge)The average system load over fifteen minutes normalized by the number of CPUs.
system.load.norm.5 (gauge)The average system load over five minutes normalized by the number of CPUs.

The system.load.* metric is Unix specific: it conveys the average amount of resources either waiting to use or currently using the CPU. Each process waiting to use or using the CPU increases the load number by 1. The number at the end of the metric name indicates the average number of these processes in the previous X minutes. For example, system.load.5 is the average over the last 5 minutes. A value of 0 indicates a completely idle CPU, and a number equal to the number of CPU cores in the environment indicates that the CPU can handle every request coming in with no delay. Any number greater than this means that processes are waiting to use the CPU.

Where is System Load for Windows?

While Windows does not offer this exact metric, there is an equivalent option that’s available by default in the system metrics: system.proc.queue.length. The system.proc.queue.length metric allows you to see the number of threads that are observed as delayed in the processor ready queue and are waiting to be executed.

Monitoring Windows Processes

You can monitor Windows processes with Live Process Monitoring. To enable this on Windows, edit the Agent main configuration file by setting the following parameter to true:

datadog.yaml:

process_config:
  enabled: "true"

After configuration is complete, restart the Agent.

Further Reading