SQL Server Windows Service

Microsoft.SQLServer.Windows.Monitor.LocalDBEngine.ServiceStatus (UnitMonitor)

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

Knowledge Base article:

Summary

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

Note that due to specific behavior of cluster nodes, this monitor will be in a Healthy state for all SQL Server cluster instances where the SQL Server role is stopped. To make sure the monitor shows the actual state, enable the SQL Server role.

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 view other alerts for this instance of SQL Server that may be related to this issue using the following link:

View SQL Server Alerts

Overridable 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

Synchronization Time

The synchronization time specified by using a 24-hour format. May be omitted.

 

Unavailable Time (seconds)

The minimum duration of service unavailability before considering it unhealthy.

900

Element properties:

TargetMicrosoft.SQLServer.Windows.LocalDBEngine
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.Windows.MonitorType.LocalDBEngine.ServiceStatus
RemotableTrue
AccessibilityPublic
Alert Message
MSSQL on Windows: SQL Server service stopped
The Windows service for the SQL Server instance "{1}" has stopped on computer "{2}"
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.Windows.Monitor.LocalDBEngine.ServiceStatus" Accessibility="Public" Enabled="true" Target="SqlDiscW!Microsoft.SQLServer.Windows.LocalDBEngine" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.Windows.MonitorType.LocalDBEngine.ServiceStatus" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.Windows.Monitor.LocalDBEngine.ServiceStatus.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</AlertParameter1>
<AlertParameter2>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</AlertParameter2>
<AlertParameter3>$Target/Property[Type="SqlDiscW!Microsoft.SQLServer.Windows.DBEngine"]/PrincipalName$</AlertParameter3>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Running" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="NotRunning" HealthState="Error"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>60</IntervalSeconds>
<SyncTime/>
<PrincipalName>$Target/Property[Type="SqlDiscW!Microsoft.SQLServer.Windows.DBEngine"]/PrincipalName$</PrincipalName>
<ServiceName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ServiceName$</ServiceName>
<CheckStartupType>true</CheckStartupType>
<UnavailableTime>900</UnavailableTime>
</Configuration>
</UnitMonitor>