SQL Server 代理 Windows 服务

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

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

Knowledge Base article:

摘要

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

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

原因

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

解决方法

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

启动 SQL 代理服务

Element properties:

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

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2008.Agent.ServiceMonitor" Accessibility="Public" Enabled="true" Target="SQL2008Core!Microsoft.SQLServer.2008.Agent" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Windows!Microsoft.Windows.CheckNTServiceStateMonitorType" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2008.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="SQL!Microsoft.SQLServer.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="SQL!Microsoft.SQLServer.Agent"]/ServiceName$</ServiceName>
<CheckStartupType>true</CheckStartupType>
</Configuration>
</UnitMonitor>