作业队列长度

Microsoft.SystemCenter.ServiceManagementAutomation.2012R2.Monitor.MessageQueueLength (UnitMonitor)

检查 Runbook Worker 队列中的作业数。

Knowledge Base article:

摘要

确定作业队列长度是否已超过指定的阈值。此队列存储在 Service Management Automation 数据库中,因此必须将监视器配置为有权访问此数据库。有关信息,请参阅“配置”部分。

原因

如果作业队列长度已经达到临界极限,则 Worker 无法适当地处理作业负荷。作业提交率高于作业处理率。

解决方法

增加 Worker 角色的数目。

配置

为了让此监视器正常工作,此监视器必须有权读取 Service Management Automation 数据库。请创建有权读取数据库的运行方式帐户,并将其添加到名为“Microsoft Service Management Automation 数据库帐户”的运行方式配置文件中。

可以在此监视器上配置以下选项:

选项

定义

默认值

警报所处状态

生成警报的监视器的健康状况。

监视器处于严重健康状况

警报优先级

针对此监视器生成的警报的优先级。

警报严重性

针对此监视器生成的警报的优先级。

严重

自动解决警报

指定当监视器恢复正常状态时是否应该自动解决警报。

已启用

指定是否应该运行监视器。

ErrorThreshold

生成严重健康状况的队列中的消息数。

20

生成警报

指定当更改为警告或严重状态时监视器是否应该生成警报。

间隔

监视器运行间隔时间的秒数。

300

WarningThreshold

生成警告健康状况的队列中的消息数。

10

Element properties:

TargetMicrosoft.SystemCenter.ServiceManagementAutomation.2012R2.Server.Worker
Parent MonitorSystem.Health.PerformanceState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SystemCenter.ServiceManagementAutomation.2012R2.MonitorType.MessageQueueLength
RemotableTrue
AccessibilityPublic
Alert Message
作业队列长度已超过阈值。
作业队列长度已超过阈值。上一个测量值为 {0}。
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SystemCenter.ServiceManagementAutomation.2012R2.Monitor.MessageQueueLength" Accessibility="Public" Enabled="true" Target="Microsoft.SystemCenter.ServiceManagementAutomation.2012R2.Server.Worker" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SystemCenter.ServiceManagementAutomation.2012R2.MonitorType.MessageQueueLength" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SystemCenter.ServiceManagementAutomation.2012R2.Monitor.MessageQueueLength.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Value$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="UnderThreshold" MonitorTypeStateID="UnderThreshold" HealthState="Success"/>
<OperationalState ID="OverWarningThreshold" MonitorTypeStateID="OverWarningThreshold" HealthState="Warning"/>
<OperationalState ID="OverErrorThreshold" MonitorTypeStateID="OverErrorThreshold" HealthState="Error"/>
</OperationalStates>
<Configuration>
<Interval>300</Interval>
<DatabaseServer>$Target/Property[Type="SMA!Microsoft.SystemCenter.ServiceManagementAutomation.Server"]/DatabaseServerName$</DatabaseServer>
<DatabaseInstance>$Target/Property[Type="SMA!Microsoft.SystemCenter.ServiceManagementAutomation.Server"]/DatabaseServerInstance$</DatabaseInstance>
<DatabaseName>$Target/Property[Type="SMA!Microsoft.SystemCenter.ServiceManagementAutomation.Server"]/DatabaseName$</DatabaseName>
<WarningThreshold>10</WarningThreshold>
<ErrorThreshold>20</ErrorThreshold>
</Configuration>
</UnitMonitor>