Availability of the Distribution database from a Subscriber

Microsoft.SQLServer.2016.Replication.Monitor.DistributionDBAvailabilityFromSubscriber (UnitMonitor)

This monitor checks availability of the Distribution database from the Subscriber.

Knowledge Base article:

Summary

The Subscriber is not able to reach its distribution database.

Configuration

To use this monitor, it is necessary to add administrator privileges in "Microsoft SQL Server Replication Distributor Availability from Subscriber Monitoring Run As Profile".

Db names in the db names list string should be separated by commas.

A db name should meet requirements of one of the next identifier classes:

1) Regular

- A letter as defined by the Unicode Standard 3.2. The Unicode definition of letters includes Latin characters from a to z, from A to Z, and also letter characters from other languages.

- The underscore (_)

- letters as defined in the Unicode Standard 3.2;

- decimal numbers from either Basic Latin or other scripts;

- the at sign (@), dollar sign ($), number sign (#), or underscore (_).

2) Delimited – can contain any characters, and should be delimited by double quotes or square brackets.

3) Undelimited – can be almost any character sequence, and should meet the next requirements:

Any db name belonging to any of the classes above should be from 1 to 128 characters, not including the delimiter characters.

For more information, see https://msdn.microsoft.com/en-us/library/ms175874 page.

Causes

This situation may be caused by:

Resolutions

Verify the following conditions:

Additional

If there is a firewall in your replication topology, you may want to read the following article: http://support.microsoft.com/kb/164667/

To add LocalAccountTokenFilterPolicy key, execute the following:

reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f

Overrideable Parameters

Name

Description

Default Value

Alert Priority

Defines Alert Priority.

Normal

Alert Severity

Defines Alert Severity.

Error

CredSsp Enabled

Indicates that CredSsp is enabled prior to running this workflow. Will leave it enabled after the run

Yes

Database Names

List of names for databases that should be checked, delimited by ',' symbol

 

Enabled

Enables or disables the workflow.

No

Generates Alerts

Defines whether the workflow generates an Alert.

Yes

Interval (seconds)

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

300

Port

Port of wsman service

5985

Prefix

Name of the wsman service

wsman

Subscriber Names

List of names of subscribers that should be used as a check source, delimited by '|' symbol

 

Synchronization Time

Synchronization Time

 

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

Transport

Prefix of the protocol to access the wsman service

http

Element properties:

TargetMicrosoft.SQLServer.2016.Replication.Distributor
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledFalse
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2016.Replication.MonitorType.DistributorAvailabilityFromSubscriberMonitorType
RemotableTrue
AccessibilityPublic
Alert Message
MSSQL2016 Replication: The Distribution Database is not available from the Subscriber.
The Distribution Database is not available from the Subscribers ({0})
{1}
RunAsMicrosoft.SQLServer.Replication.Monitoring.DistributorAvailabilityFromSubscriberMonitor.RunAs.Monitor

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2016.Replication.Monitor.DistributionDBAvailabilityFromSubscriber" Accessibility="Public" Enabled="false" Target="MS2RD!Microsoft.SQLServer.2016.Replication.Distributor" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2016.Replication.MonitorType.DistributorAvailabilityFromSubscriberMonitorType" ConfirmDelivery="false" RunAs="MSRL!Microsoft.SQLServer.Replication.Monitoring.DistributorAvailabilityFromSubscriberMonitor.RunAs.Monitor">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2016.Replication.Monitor.DistributionDBAvailabilityFromSubscriber.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Property[@Name='Subscriber']$</AlertParameter1>
<AlertParameter2>$Data/Context/Property[@Name='Message']$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
<OperationalState ID="Success" MonitorTypeStateID="Health" HealthState="Success"/>
</OperationalStates>
<Configuration>
<Distributor>$Target/Property[Type='MSRL!Microsoft.SQLServer.Replication.Library.GenericDistributor']/ConnectionString$</Distributor>
<Subscriber/>
<Domain>$RunAs[Name="MSRL!Microsoft.SQLServer.Replication.Monitoring.DistributorAvailabilityFromSubscriberMonitor.RunAs.Monitor"]/Domain$</Domain>
<User>$RunAs[Name="MSRL!Microsoft.SQLServer.Replication.Monitoring.DistributorAvailabilityFromSubscriberMonitor.RunAs.Monitor"]/UserName$</User>
<Pass>$RunAs[Name="MSRL!Microsoft.SQLServer.Replication.Monitoring.DistributorAvailabilityFromSubscriberMonitor.RunAs.Monitor"]/Password$</Pass>
<Transport>http</Transport>
<Prefix>wsman</Prefix>
<Port>5985</Port>
<DatabaseNames/>
<CredSspEnabled>true</CredSspEnabled>
<IntervalSeconds>300</IntervalSeconds>
<SqlTimeout>15</SqlTimeout>
<SyncTime/>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>