SQL Server Windows Service

Microsoft.SQLServer.2016.DBEngine.ServiceMonitor (UnitMonitor)

This monitor checks the status of the SQL Server Database Engine service.

Knowledge Base article:

Summary

This monitor checks the state of the SQL Database Engine Windows Service.

Causes

"Not Running" state of this monitor indicates that SQL DB Engine service is configured to start automatically but is in the "Stopped" state and had not been started within the specific time interval. The duration of the interval is defined by "Unavailable Time" monitor property and could be overridden. By default this value is 900 secs (15 mins). If SQL DB Engine turns back to "Running" state faster than that time it means that it was just a restart.

If this monitor is too noisy in specific environment please increase "Unavailable Time". Otherwise if it is too latent, please reduce "Unavailable Time" setting.

In general windows service could be stopped by many reasons, including:

Resolutions

You can attempt to restart the service using the following link:

Start SQL DB Engine service

You can view other alerts for this instance of SQL Server that may be related to this issue using the following link:

View SQL Server Alerts

Overrideable Parameters

Name

Description

Default Value

Alert Priority

Defines Alert Priority.

Normal

Alert Severity

Defines Alert Severity.

Error

Alert only if service startup type is automatic

This may only be set to 'true' or 'false'. The workflow will not consider the current startup type setting of the service if this parameter is set to 'false'. Default is 'true'.

Yes

Enabled

Enables or disables the workflow.

Yes

Generates Alerts

Defines whether the workflow generates an Alert.

Yes

Interval (seconds)

The recurring interval of time in seconds in which to run the workflow.

60

Unavailable Time (seconds)

The minimum duration of service unavailability before considering it unhealthy.

900

Element properties:

TargetMicrosoft.SQLServer.2016.DBEngine
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2016.CheckWinServiceStateMonitorType
RemotableTrue
AccessibilityPublic
Alert Message
MSSQL 2016: SQL Server Service Stopped
The Windows service for the DB Engine instance {1} has stopped on computer {0}
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2016.DBEngine.ServiceMonitor" Accessibility="Public" Enabled="true" Target="SQL2016Core!Microsoft.SQLServer.2016.DBEngine" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2016.CheckWinServiceStateMonitorType" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2016.DBEngine.ServiceMonitor.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter1>
<AlertParameter2>$Target/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.ServerRole"]/InstanceName$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Running" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="NotRunning" HealthState="Error"/>
</OperationalStates>
<Configuration>
<Frequency>60</Frequency>
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<ServiceName>$Target/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.DBEngine"]/ServiceName$</ServiceName>
<CheckStartupType>true</CheckStartupType>
<UnavailableTime>900</UnavailableTime>
</Configuration>
</UnitMonitor>