作业周期

Microsoft.SQLServer.2012.AgentJob.JobDuration (UnitMonitor)

监视代理作业周期。
请注意,任何版本的 SQL Server Express 均不支持 SQL Server 代理 Windows 服务,没有合适的发现对象。

Knowledge Base article:

摘要

SQL 2012 代理作业持续时间监视器。监视代理作业周期。

配置

可替代参数

名称

说明

默认值

已启用

启用或禁用工作流。

生成警报

定义工作流是否生成警报。

间隔(秒)

此监视器使用脚本对长期运行的作业进行监视。这是执行该脚本的时间间隔(秒)。

600

阈值下限(分钟)

该监视器的阈值下限(分钟)。默认情况下,超过该阈值至少会导致监视器进入警告状态。

60

同步时间

使用 24 小时格式指定的同步时间。可以忽略。

 

超时(秒)

指定允许工作流在被关闭并标记为失败之前运行的时间。

300

阈值上限(分钟)

该监视器的阈值上限(分钟)。默认情况下,超过该阈值会导致监视器进入严重状态。介于该阈值与阈值下限(包括下限)之间会导致(默认情况下)监视器处于警告状态。

120

Element properties:

TargetMicrosoft.SQLServer.2012.AgentJob
Parent MonitorSystem.Health.PerformanceState
CategoryPerformanceCollection
EnabledTrue
Alert GenerateFalse
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2012.AgentLongRunningJobsProviderPerJob
RemotableTrue
AccessibilityPublic
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2012.AgentJob.JobDuration" Accessibility="Public" Enabled="true" Target="SQL2012Core!Microsoft.SQLServer.2012.AgentJob" ParentMonitorID="SystemHealth!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2012.AgentLongRunningJobsProviderPerJob" ConfirmDelivery="false">
<Category>PerformanceCollection</Category>
<OperationalStates>
<OperationalState ID="UnderThreshold1" MonitorTypeStateID="UnderThreshold1" HealthState="Success"/>
<OperationalState ID="OverThreshold1UnderThreshold2" MonitorTypeStateID="OverThreshold1UnderThreshold2" HealthState="Warning"/>
<OperationalState ID="OverThreshold2" MonitorTypeStateID="OverThreshold2" HealthState="Error"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>600</IntervalSeconds>
<SyncTime/>
<ConnectionString>$Target/Host/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ConnectionString$</ConnectionString>
<JobID>$Target/Property[Type="SQL!Microsoft.SQLServer.AgentJob"]/JobID$</JobID>
<Threshold1>60</Threshold1>
<Threshold2>120</Threshold2>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>