---
title: "IIS Integration"
description: "Monitor Microsoft IIS with the Middleware Windows agent. Track app pool state and uptime, requests, request queues, connections and traffic, and get alerted when an app pool goes down."
section: "Integrations"
breadcrumb: "Integrations > Web Servers > IIS"
canonical: "https://docs.middleware.io/integrations/iis-integration"
---
# IIS Integration

The IIS integration collects metrics from Internet Information Services (IIS) on Windows Server through the Middleware Windows agent. Use it to see the state of every app pool, alert when one stops, and track requests, queues, connections and traffic per site.

The agent reads the local IIS performance counters, so there is no endpoint, port or password to configure.

## Prerequisites

- Windows Server with the **Web Server (IIS)** role installed.
- The Middleware Windows agent `v2.0.1` or later, installed on the IIS server. [See Installing the Agent](/agent-installation/overview)

> **Note:** Hosts on an older agent version ignore the IIS setting until the agent is upgraded. Nothing breaks; the IIS metrics just don't appear yet.

## Setup

#### 1 Open the Integration in Middleware

Go to **Installation > Integrations**, then open **IIS** (under the **Windows** category).

#### 2 Choose the Hosts

Select the Windows hosts that run IIS.

#### 3 Set the Collection Interval

**Collection Interval** is how often the agent reads the IIS counters. It defaults to `60s`. Use a shorter value, such as `30s`, if you want app pool alerts to react faster.

#### 4 Save

Click **Save Configuration**. The agent picks up the new configuration and starts sending IIS metrics within a few minutes.

## Visualize Your Data

Open **Dashboards** and select the prebuilt **IIS** dashboard. It shows app pool state and uptime, and per-site requests, connections and traffic.

The **Data Collected** tab of the IIS integration lists every metric the integration reports.

## Alert When an App Pool Goes Down

Go to **Alerts > Create Alert** and create a metric alert with:

| Setting | Value |
| --- | --- |
| Metric | `iis.application_pool.state`, aggregated with `max` |
| Group by | `host.name`, `iis.application_pool` |
| Condition | above `3` |
| Evaluate | `min` over 5 minutes |
| Notify on no data | on |

App pool state values:

| Value | State |
| --- | --- |
| 1 | Uninitialized |
| 2 | Initialized |
| 3 | Running |
| 4 | Disabling |
| 5 | Disabled (stopped) |
| 6 | Shutdown pending |
| 7 | Delete pending |

A pool that is stopped by hand, or stopped by IIS rapid-fail protection after its worker process keeps crashing, reports `5` and keeps reporting it. So "above 3" catches both. **Notify on no data** covers the case where the pool is deleted or the agent stops reporting.

## Metrics Collected

### App Pools

Reported per app pool, with the `iis.application_pool` attribute.

| Metric | Description |
| --- | --- |
| `iis.application_pool.state` | Current state of the app pool (see the table above). |
| `iis.application_pool.uptime` | Time since the app pool last started. |
| `iis.request.queue.count` | Requests waiting in the app pool's queue. |
| `iis.request.queue.age.max` | Age of the oldest request in the queue. |
| `iis.request.rejected` | Requests rejected by the app pool. |

### Sites

Reported per site, with the `iis.site` attribute.

| Metric | Description |
| --- | --- |
| `iis.request.count` | Requests, by HTTP method (`request` attribute). |
| `iis.connection.active` | Active connections. |
| `iis.connection.attempt.count` | Connection attempts. |
| `iis.connection.anonymous` | Connections made anonymously. |
| `iis.network.io` | Bytes sent and received (`direction` attribute). |
| `iis.network.file.count` | Files sent and received (`direction` attribute). |
| `iis.network.blocked` | Bytes blocked by bandwidth throttling. |
| `iis.uptime` | Time since the site's web service started. |

### Server

| Metric | Description |
| --- | --- |
| `iis.thread.active` | Active IIS threads. |

> **Note:** - `iis.application_pool.uptime` can occasionally be missing for all app pools, when Windows fails to read the uptime counter. Alert on `iis.application_pool.state`, not on uptime.
> - You may see an app pool named `---1` on the request queue metrics. It is an internal Windows HTTP queue that does not belong to any pool, and can be ignored.

## Troubleshooting

#### No IIS metrics appear

- Check that the host runs the Windows agent `v2.0.1` or later.
- Check that the IIS role is installed and the **World Wide Web Publishing Service** (`W3SVC`) is running.
- Wait a few minutes after saving: the agent applies new configuration on its next check.

#### An app pool I stopped does not show as down

With the settings above, the alert waits until the pool has been down for the whole 5-minute window, so a brief recycle does not page you. Shorten the window if you need a faster alert.

Need assistance or want to learn more about Middleware? Get in touch with us via our Contact Us page or join our Slack channel.
