MSSQL on Windows Replication: Count of Failed Replication Agents Jobs on the Distributor

Microsoft.SQLServer.Replication.Windows.CollectionRule.Distributor.ReplicationAgentFailJobsPerformanceCounter (Rule)

This rule collects the following failed Replication agent jobs: Merge, Distribution, and Snapshot Agents.

Knowledge Base article:

Summary

This rule collects the following failed Replication agent jobs: Merge, Distribution, and Snapshot Agents.

Overrideable Parameters

Name

Description

Default Value

Enabled

Enables or disables the workflow.

Yes

Interval (seconds)

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

300

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.

200

Timeout for database connection (seconds)

The workflow will fail and register an event if it cannot access the database during the specified period.

15

Element properties:

TargetMicrosoft.SQLServer.Replication.Windows.Distributor
CategoryPerformanceCollection
EnabledTrue
Alert GenerateFalse
RemotableTrue

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.SQLServer.Replication.Windows.DataSource.DistributorFailJobsMonitor Microsoft.SQLServer.Core.RunAs.Monitoring
Mapper ConditionDetection System.Performance.DataGenericMapper Default
WriteToDatabase WriteAction Microsoft.SystemCenter.CollectPerformanceData Default
WriteToDW WriteAction Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData Default

Source Code:

<Rule ID="Microsoft.SQLServer.Replication.Windows.CollectionRule.Distributor.ReplicationAgentFailJobsPerformanceCounter" Enabled="true" Target="SQLReplWD!Microsoft.SQLServer.Replication.Windows.Distributor" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>PerformanceCollection</Category>
<DataSources>
<DataSource ID="DS" TypeID="Microsoft.SQLServer.Replication.Windows.DataSource.DistributorFailJobsMonitor" RunAs="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.Monitoring">
<MachineName>$Target/Host/Property[Type='SqlCoreLib!Microsoft.SQLServer.Core.DBEngine']/MachineName$</MachineName>
<NetbiosComputerName>$Target/Host/Property[Type='SqlCoreLib!Microsoft.SQLServer.Core.DBEngine']/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Target/Host/Property[Type='SqlCoreLib!Microsoft.SQLServer.Core.DBEngine']/InstanceName$</InstanceName>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<ConnectionString>$Target/Host/Property[Type='SqlCoreLib!Microsoft.SQLServer.Core.DBEngine']/ConnectionString$</ConnectionString>
<MonitoringType>$Target/Host/Property[Type="SqlDiscW!Microsoft.SQLServer.Windows.DBEngine"]/MonitoringType$</MonitoringType>
<NumberOfConsecutiveFails>1</NumberOfConsecutiveFails>
<CategoryList>Distribution, Merge, Snapshot</CategoryList>
<ExcludeCategoryList/>
<IntervalSeconds>300</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>200</TimeoutSeconds>
</DataSource>
</DataSources>
<ConditionDetection ID="Mapper" TypeID="Perf!System.Performance.DataGenericMapper">
<ObjectName>$Target/Host/Property[Type='SqlCoreLib!Microsoft.SQLServer.Core.DBEngine']/InstanceName$</ObjectName>
<CounterName>Distributor: Count of Failed Jobs</CounterName>
<InstanceName/>
<Value>$Data/Property[@Name='DistributorFailJobs']$</Value>
</ConditionDetection>
<WriteActions>
<WriteAction ID="WriteToDatabase" TypeID="SC!Microsoft.SystemCenter.CollectPerformanceData"/>
<WriteAction ID="WriteToDW" TypeID="SCDW!Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData"/>
</WriteActions>
</Rule>