Job Duration

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

Monitors Agent Job Duration.
Note that SQL Server Agent Windows Service is not supported by any edition of SQL Server Express; there is no appropriate discovered object.

Knowledge Base article:

Summary

SQL 2008 Agent Job Duration Monitor. Monitors Agent Job Duration.

Configuration

Overrideable Parameters

Name

Description

Default Value

Enabled

Enables or disables the workflow.

Yes

Generates Alerts

Defines whether the workflow generates an Alert.

No

Interval (seconds)

This monitor uses a script to perform its monitoring of long running jobs. This is the interval (in seconds) between executions of that script.

600

Lower Threshold (minutes)

The lower threshold (in minutes) for this monitor. By default, exceeding this threshold will result in the monitor changing to at least a warning state.

60

Synchronization Time

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

 

Timeout (seconds)

the amount of time (in seconds) that the script is allowed to run.

300

Upper Threshold (minutes)

The upper threshold (in minutes) for this monitor. By default, exceeding this threshold will result in the monitor changing to a critical state. Being between this threshold and the lower threshold (inclusive) will result (by default) in the monitor being in a warning state.

120

Element properties:

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

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2008.AgentJob.JobDuration" Accessibility="Public" Enabled="true" Target="SQL2008Core!Microsoft.SQLServer.2008.AgentJob" ParentMonitorID="SystemHealth!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2008.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>