SQL Server Agent State for Publisher

Microsoft.SQLServer.2014.Replication.Monitor.PublisherAvailabilityMonitor (UnitMonitor)

This monitor checks if the SQL Server Agent is running on Publisher.

Knowledge Base article:

Summary

This monitor connects to the Replication Publisher and verifies if the SQL Server Agent service is running. The SQL Server Agent service is installed automatically during the SQL Server setup. This Windows service is used by Replication to start and stop the Replication SQL Server Agent Jobs which are responsible for data movement.

Causes

The SQL Server Agent Service may have been manually stopped or stopped as result of a failure of the agent. Examine the Windows Application Event log for possible causes for an unexpected stopped Agent service.

If the Agent "Start Mode" property is set to "Manual" instead of “Automatic”, the SQL Server Agent service will not automatically restart upon reboot of the server.

Resolutions

Start the SQL Server Agent service under Windows Services, SQL Server Configuration Manager, or via SQL Server Management Studio. If the agent "Start Mode" is set to "Manual", consider changing to "Automatic".

Start, Stop, or Pause the SQL Server Agent Service http://technet.microsoft.com/library/ms190695.aspx

Additional

On the Publisher, in addition to the Log Reader Agent Snapshot Agent, and push Distribution Agent, the SQL Server Agent Service is also responsible for running miscellaneous agents such as the "Agent history clean up: distribution", "Distribution clean up: distribution", and "Expired subscription cleanup" agents.

External

Use the following link to view the SQL Server Agent Error Log: http://msdn.microsoft.com/library/ms175488.aspx

This topic describes how to configure Microsoft SQL Server Agent to automatically restart if it should stop unexpectedly in SQL Server 2014. https://msdn.microsoft.com/library/ms178130.aspx

Overrideable Parameters

Name

Description

Default Value

Alert Priority

Defines Alert Priority.

Normal

Alert Severity

Defines Alert Severity.

Error

Enabled

Enables or disables the workflow.

Yes

Generates Alerts

Defines whether the workflow generates an Alert.

Yes

Element properties:

TargetMicrosoft.SQLServer.2014.Replication.Publisher
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2014.Replication.MonitorType.CheckReplicationServiceState
RemotableTrue
AccessibilityPublic
Alert Message
MSSQL2014 Replication: Publisher: SQL Server Agent Windows Service is stopped.
The SQL Server Agent windows service is stopped on SQL Server Instance {1} on server {0}.
RunAsMicrosoft.SQLServer.Replication.Monitoring.RunAs.Monitor

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2014.Replication.Monitor.PublisherAvailabilityMonitor" Accessibility="Public" Enabled="true" Target="MS2RD!Microsoft.SQLServer.2014.Replication.Publisher" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2014.Replication.MonitorType.CheckReplicationServiceState" ConfirmDelivery="false" RunAs="MSRL!Microsoft.SQLServer.Replication.Monitoring.RunAs.Monitor">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2014.Replication.Monitor.PublisherAvailabilityMonitor.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter1>
<AlertParameter2>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Library.GenericPublisher"]/ConnectionString$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Running" HealthState="Success"/>
<OperationalState ID="Warning" MonitorTypeStateID="RunningManual" HealthState="Warning"/>
<OperationalState ID="Error" MonitorTypeStateID="NotRunning" HealthState="Error"/>
</OperationalStates>
<Configuration>
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<ServiceName>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Library.GenericPublisher"]/AgentServiceName$</ServiceName>
</Configuration>
</UnitMonitor>