Last Run Status

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

SQL 2012 Agent Job Last Run State Monitor. Monitors the last run state of an SQL Agent Job.
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 2012 Agent Job Last Run State Monitor. Monitors the last run state of an SQL Agent Job.

Configuration

IntervalSeconds (sec) default 600.

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)

The recurring interval of time in seconds in which to run the workflow.

600

Synchronization Time

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

 

Timeout (seconds)

Specifies the time the workflow is allowed to run before being closed and marked as failed.

300

Element properties:

TargetMicrosoft.SQLServer.2012.AgentJob
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateFalse
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2012.AgentJobLastRunProvider
RemotableTrue
AccessibilityPublic
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2012.AgentJob.JobLastRunState" Accessibility="Public" Enabled="true" Target="SQL2012Core!Microsoft.SQLServer.2012.AgentJob" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2012.AgentJobLastRunProvider" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<OperationalStates>
<OperationalState ID="LastRunSucceeded" MonitorTypeStateID="LastRunSucceeded" HealthState="Success"/>
<OperationalState ID="LastRunFailed" MonitorTypeStateID="LastRunFailed" HealthState="Warning"/>
</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>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>