Skip to content

IIS over WinRM (win_iis) ​

Reads Internet Information Services over WinRM: whether the two services that run it are up, how busy a site is, and whether every application pool is running. A stopped pool is the commonest way a site goes down while the server stays up, which is why the pools are counted here and not left to a service sensor.

Transport. Under a Windows probe the device can be set to read this sensor over native WMI instead of WinRM; the queries and the result are the same. The target is then set up as in the WMI setup guide instead.

What it looks like ​

The page of a win_iis sensor in the light theme

The sensor's page after a few polls, watching IIS on a Windows Server domain controller reached over WinRM. In the dark theme: the sensor's page. The form for adding it, with its parameters filled in: light, dark.

Channels ​

KeyNameUnitDefault limits
w3svc_stateWeb service (W3SVC)Running is Up, Stopped is Down, anything else is Warning
was_stateProcess activation (WAS)the same
connectionsCurrent connectionsnone
requests_psRequestsreq/snone
in_bpsReceivedB/snone
out_bpsSentB/snone
not_found_psNot found errorserr/snone
poolsApplication poolsnone
pools_not_runningApplication pools not runningerror above 0

The two state channels use the same numbers and labels as win_service.

Parameters ​

ParameterDefaultMeaning
site_TotalThe site whose traffic is reported, named as IIS Manager names it (Default Web Site). Case does not matter. _Total is every site together.
app_poolevery poolCount only this application pool. Leave it out unless a pool is stopped on purpose, in which case a second sensor for the one pool you care about is the cleaner way.
port5985, or 5986 with httpsTCP port of the WinRM listener.
httpsfalseUse the HTTPS listener instead of HTTP with message encryption.
accept_self_signedfalseAccept an HTTPS certificate that cannot be verified. The credential has the same switch; either one is enough.

Suggested interval: 60 seconds. Credential: Windows. Discovery proposes one on a host whose World Wide Web Publishing Service is installed and set to start automatically, next to the win_service sensor for the same service.

What it reads, and why these counters ​

Three queries go out in one session.

  • The services come from Win32_Service: W3SVC, which serves requests, and WAS, which starts the application pools. Either one stopped means no site works, so either one stopped is Down.
  • The traffic comes from Win32_PerfRawData_W3SVC_WebService, the Web Service performance object, one instance per site and _Total. Current connections is a gauge. Requests, bytes received and sent and not-found errors are cumulative counters, so each is the difference between two polls divided by the time between them on the target's clock, the way win_disk_io does it. The raw class is used and not the formatted one because a formatted rate needs two readings in one WMI session, and every poll is a new session. Requests are all HTTP methods together (TotalMethodRequests). A rising rate of not-found errors is usually a deployment that moved a file or a crawler, and is shown but has no default limit, because it is only a problem relative to what the site normally sees.
  • The application pools come from Win32_PerfRawData_APPPOOLCountersProvider_APPPOOLWAS, which carries each pool's state as a number: 1 uninitialised, 2 initialised, 3 running, 4 disabling, 5 stopped, 6 shutdown pending, 7 delayed shutdown. Anything but 3 counts as not running and is named in the message (DefaultAppPool is stopped). A pool with no worker process yet is running: IIS starts the process on the first request. The WebAdministration provider would give the same state but only through a method call, which a WQL enumeration cannot make, and it needs the IIS management scripting tools installed.

While either service is stopped none of the counters exist, so the poll reports the two service states and leaves the others unknown. Rates are unknown for the first poll, after the machine restarts and for the interval in which a counter went backwards.

On the target ​

WinRM enabled and an account set up as in the WinRM setup guide, including membership of Performance Monitor Users, because every counter here is a performance counter. IIS needs no setting.

If the sensor fails with the IIS web service counters are empty, WMI has the counter classes but lists no instances in them. That happens when WMI built its list of counters before IIS was installed. Restart the Windows Management Instrumentation service on the target (Restart-Service Winmgmt -Force) or run winmgmt /resyncperf, and the instances appear. This was seen on the lab server, where both IIS and SQL Server returned nothing until WMI was restarted.

Failures ​

The WinRM failures every Windows sensor shares are listed in the setup guide. Specific to this sensor:

MessageMeaning
there is no World Wide Web Publishing Service (W3SVC) on the target, so IIS is not installed (kind config)The role is not installed, or was removed.
the IIS site X does not exist on the target (it lists ...) (kind config)A site was renamed or deleted. The message lists the sites the counters know.
the application pool X does not exist on the target (...) (kind config)The pool in app_pool is gone.
the IIS web service counters are empty or the IIS application pool counters are empty (kind protocol)See above: restart WMI.

Verification ​

Checked against WS-Man responses recorded from a real Windows Server 2022 domain controller that runs IIS 10 (one site, three application pools), read about eight seconds apart so the rates have real counters behind them, and against that machine live over NTLM with message encryption. The recorded server was almost idle, so the traffic figures are small; the rate arithmetic is also checked with counters written in the test. The stopped state of a pool was seen live (state 5 while the pool was stopped with Stop-WebAppPool) but the test for it uses an answer written by hand, and says so. Not seen: several sites, an HTTPS binding, a pool in a state other than running or stopped, a web farm, IIS 7.5 or older, and native WMI over DCOM.

Live tests: PROBEWARD_TEST_WINRM_HOST, _USER and _PASSWORD as for the other Windows sensors, and PROBEWARD_TEST_WINRM_ROLES containing iis to say the machine runs IIS.

AGPL-3.0-only