SQL Server 代理 Windows 服务

Microsoft.SQLServer.2014.Agent.ServiceMonitor (UnitMonitor)

此监视器检查此 SQL Server 实例的 SQL 代理服务的状态。

Knowledge Base article:

摘要

此监视器检查 SQL 代理服务的状态,并在该服务设置为自动启动且未运行时生成警报。

请注意,服务被禁用时不会生成警报,并且将显示正常运行状态。

原因

服务可以由于很多原因而停止,包括: :

解决方法

您可以使用以下链接尝试重新启动 SQL 代理的 Windows 服务: :

启动 SQL 代理服务

可替代参数

名称

说明

默认值

仅当服务启动类型为“自动”时发出警报

此值只能设置为 "true" 或 "false"。如果设置为 "false",则无论将启动类型设置为什么都将触发警报。默认值为 "true"。

1

已启用

 

生成警报

 

Element properties:

TargetMicrosoft.SQLServer.2014.Agent
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.Windows.CheckNTServiceStateMonitorType
RemotableTrue
AccessibilityPublic
Alert Message
MSSQL 2014: SQL Server 代理 Windows 已停止
计算机 {0} 上的 SQL Server 实例 {1} 的 SQL Server 代理的 Windows 服务已停止
RunAsDefault

Source Code:

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