IIS
Datadog's Research Report: The State of Serverless Report: The State of Serverless

IIS

Agent Check Agent Check

Supported OS: Windows

IIS Graph

Overview

Collect IIS metrics aggregated across all of your sites, or on a per-site basis. The IIS Agent check collects metrics for active connections, bytes sent and received, request count by HTTP method, and more. It also sends a service check for each site, letting you know whether it’s up or down.

Setup

Installation

The IIS check is packaged with the Agent. To start gathering your IIS metrics and logs, you need to:

  1. Install the Agent on your IIS servers.

  2. Your IIS servers must have the Win32_PerfFormattedData_W3SVC_WebService WMI class installed. You can check for this using the following command:

    Get-WmiObject -List -Namespace root\cimv2 | select -Property name | where name -like "*Win32_PerfFormattedData_W3SVC*"

    This class should be installed as part of the web-http-common Windows Feature:

    PS C:\Users\vagrant> Get-WindowsFeature web-* | where installstate -eq installed | ft -AutoSize
    
    Display Name                       Name               Install State
    ------------                       ----               -------------
    [X] Web Server (IIS)               Web-Server             Installed
    [X] Web Server                     Web-WebServer          Installed
    [X] Common HTTP Features           Web-Common-Http        Installed
    [X] Default Document               Web-Default-Doc        Installed
    [X] Directory Browsing             Web-Dir-Browsing       Installed
    [X] HTTP Errors                    Web-Http-Errors        Installed
    [X] Static Content                 Web-Static-Content     Installed

You can add the missing features with install-windowsfeature web-common-http. This requires a restart of the system to work properly.

Configuration

On your IIS servers, first resync the WMI counters. On Windows <= 2003 (or equivalent), run the following in cmd.exe:

C:/> winmgmt /clearadap
C:/> winmgmt /resyncperf

On Windows >= 2008 (or equivalent), instead run:

C:/> winmgmt /resyncperf

Host

Follow the instructions below to configure this check for an Agent running on a host. For containerized environments, see the Containerized section.

Metric collection
  1. Edit the iis.d/conf.yaml file in the Agent’s conf.d directory at the root of your Agent’s configuration directory to start collecting your IIS site data. See the sample iis.d/conf.yaml for all available configuration options.

  2. Restart the Agent to begin sending IIS metrics to Datadog.

Log collection

Available for Agent versions >6.0

  1. Collecting logs is disabled by default in the Datadog Agent, enable it in your datadog.yaml file:

    logs_enabled: true
  2. Add this configuration block to your iis.d/conf.yaml file to start collecting your IIS Logs:

    logs:
     - type: file
       path: C:\inetpub\logs\LogFiles\W3SVC1\u_ex*
       service: myservice
       source: iis

    Change the path and service parameter values and configure them for your environment. See the sample iis.d/conf.yaml for all available configuration options.

  3. Restart the Agent.

Containerized

For containerized environments, see the Autodiscovery Integration Templates for guidance on applying the parameters below.

Metric collection
ParameterValue
<INTEGRATION_NAME>iis
<INIT_CONFIG>blank or {}
<INSTANCE_CONFIG>{"host": "%%host%%"}
Log collection

Available for Agent versions >6.0

Collecting logs is disabled by default in the Datadog Agent. To enable it, see Docker log collection.

ParameterValue
<LOG_CONFIG>{"source": "iis", "service": "<SERVICE_NAME>"}

Validation

Run the Agent’s status subcommand and look for iis under the Checks section.

Data Collected

Metrics

iis.uptime
(gauge)
The amount of time the IIS server has been running
Shown as second
iis.net.bytes_sent
(gauge)
The number of bytes served per second
Shown as byte
iis.net.bytes_rcvd
(gauge)
The number of bytes received per second
Shown as byte
iis.net.bytes_total
(gauge)
The total number of bytes transferred per second
Shown as byte
iis.net.num_connections
(gauge)
The number of active connections
Shown as connection
iis.net.files_sent
(gauge)
The number of files sent per second
Shown as file
iis.net.files_rcvd
(gauge)
The number of files received per second
Shown as file
iis.net.connection_attempts
(gauge)
The number of connection attempts since service startup
Shown as connection
iis.net.connection_attempts_sec
(gauge)
The number of connection attempts per second
Shown as connection
iis.httpd_request_method.get
(gauge)
The number of GET requests per second
Shown as request
iis.httpd_request_method.post
(gauge)
The number of POST requests per second
Shown as request
iis.httpd_request_method.head
(gauge)
The number of HEAD requests per second
Shown as request
iis.httpd_request_method.put
(gauge)
The number of PUT requests per second
Shown as request
iis.httpd_request_method.delete
(gauge)
The number of DELETE requests per second
Shown as request
iis.httpd_request_method.options
(gauge)
The number of OPTIONS requests per second
Shown as request
iis.httpd_request_method.trace
(gauge)
The number of TRACE requests per second
Shown as request
iis.errors.not_found
(gauge)
The number of not found errors per second (typically reported as an HTTP 404 response code)
Shown as error
iis.errors.locked
(gauge)
The number of locked errors per second (typically reported as an HTTP 423 response code)
Shown as error
iis.users.anon
(gauge)
The number of requests from users over an anonymous connection per second
Shown as request
iis.users.nonanon
(gauge)
The number of requests from users over a non-anonymous connection per second
Shown as request
iis.requests.cgi
(gauge)
The number of Common Gateway Interface requests executed per second
Shown as request
iis.requests.isapi
(gauge)
The number of ISAPI requests executed per second
Shown as request

Events

The IIS check does not include any events.

Service Checks

iis.site_up:
The Agent submits this service check for each configured site in iis.yaml. It returns Critical if the site’s uptime is zero, otherwise returns OK.

Troubleshooting

Need help? Contact Datadog support.