Skip to content

Windows service over WinRM (win_service) ​

Reads the state of one Windows service by its short name from Win32_Service over WinRM.

Transport. Under a Windows probe the device can be set to read this sensor over native WMI instead of WinRM; the query 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_service sensor in the light theme

The sensor's page after a few polls, watching 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
stateStateRunning is Up, Stopped is Down, anything else is Warning

The value is a number with a label:

ValueLabelHealth
0UnknownWarning
1StoppedDown
2StartingWarning
3StoppingWarning
4RunningUp
5ContinuingWarning
6PausingWarning
7PausedWarning

Parameters ​

ParameterDefaultMeaning
namerequiredThe service's short name as sc query shows it (Spooler), not its display name. Case does not matter.
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.

For "is everything that should run running", use the single win_services summary sensor instead of one of these per service. Discovery proposes win_service only for server roles that are present and set to start automatically:

ServiceRoleProposed on
DNSDNS Serverany
DHCPServerDHCP Serverany
NTDSActive Directory Domain Servicesany
NetlogonNetlogondomain controllers only: it runs on every domain member, but is the role only on a DC
DFSRDFS Replicationany
W32TimeWindows Timeservers and domain controllers: it is often automatic on workstations too, where it is not a role
W3SVCIIS web serverany
MSSQLSERVER, SQLSERVERAGENTSQL Server default instance and its agentany
SpoolerPrint Spoolerservers that share at least one printer (Win32_Printer with Shared=TRUE)
vmmsHyper-V Virtual Machine Managementany
MSExchangeTransport, MSExchangeISExchange transport and information storeany

A role service that is automatic but stopped is still proposed, so the new sensor shows it Down. Any other service can be added by hand.

On the target ​

WinRM enabled and an account set up as in the WinRM setup guide. Some services restrict who may query them through their security descriptor; such a service may not be returned to an unprivileged account, and is then reported as missing.

Failures ​

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

MessageMeaning
there is no service named X on the target (kind config)The service was uninstalled, the name is the display name rather than the short name, or the account may not see it.

AGPL-3.0-only