Throws an alert if the execution time of any of your SQL Agent jobs has exceeded the specified threshold (in minutes). Note: This rule is disabled by default. Use overrides to enable it when necessary.
This rule checks whether the execution time of any of your SQL Agent jobs has exceeded the specified threshold. Note: The SQL Agent job duration is reset automatically after restarting the SQL Server Agent service.
Name | Description | Default Value |
Enabled | Enables or disables the workflow. | No |
Interval (seconds) | The recurring interval of time in seconds in which to run the workflow. | 600 |
Priority | Defines alert priority. | 1 |
Severity | Defines alert severity. | 1 |
Synchronization Time | The synchronization time specified by using a 24-hour format. Can be omitted. |
|
Threshold (minutes) | Threshold that defines the amount of time (in minutes) that is acceptable for the SQL Agent job to be running. Every time this threshold is exceeded, an alert is thrown. | 60 |
Timeout (seconds) | Specifies the time the workflow is allowed to run before being closed and marked as failed. | 300 |
Timeout for database connection (seconds) | The workflow will fail and register an event if it cannot access the database during the specified period. | 15 |
Target | Microsoft.SQLServer.Linux.AgentJob | ||
Category | Alert | ||
Enabled | False | ||
Alert Generate | True | ||
Alert Severity | Warning | ||
Alert Priority | Normal | ||
Remotable | True | ||
Alert Message |
|
ID | Module Type | TypeId | RunAs |
---|---|---|---|
DS | DataSource | Microsoft.SQLServer.Linux.DataSource.AgentJobDurationCondition | Default |
GenerateAlert | WriteAction | System.Health.GenerateAlert | Default |
<Rule ID="Microsoft.SQLServer.Linux.AlertRule.AgentJob.Duration" Target="SqlDiscL!Microsoft.SQLServer.Linux.AgentJob" Enabled="false">
<Category>Alert</Category>
<DataSources>
<DataSource ID="DS" TypeID="Microsoft.SQLServer.Linux.DataSource.AgentJobDurationCondition">
<MachineName>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</MachineName>
<NetbiosComputerName>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<JobName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.AgentJob"]/Name$</JobName>
<Threshold>60</Threshold>
<ConnectionString>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<InstanceVersion>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Version$</InstanceVersion>
<InstanceEdition>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Edition$</InstanceEdition>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>300</TimeoutSeconds>
<IntervalSeconds>600</IntervalSeconds>
<SyncTime/>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="Health!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>1</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.SQLServer.Linux.AlertRule.AgentJob.Duration.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</AlertParameter1>
<AlertParameter2>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</AlertParameter2>
<AlertParameter3>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.AgentJob"]/Name$</AlertParameter3>
<AlertParameter4>$Data/Property[@Name='Duration']$</AlertParameter4>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>