This monitor checks the status of the SQL Agent service for this instance of SQL Server.
Note that SQL Server Agent Windows Service is not supported by any edition of SQL Server Express.
This monitor checks the status of the SQL Agent service and generates an alert when the service is set to start automatically and is not running.
An alert is not generated when the service is disabled; a healthy state is shown.
Note that due to specific behavior of cluster nodes, this monitor will be in a healthy state for all SQL Server cluster instances where the SQL Server role is stopped. To make sure the monitor shows the actual state, enable the SQL Server role.
A service can stop for many reasons, including:
The service was stopped by the administrator.
The service was prevented from starting because the user account could not be authenticated.
The service encountered an exception that stopped the service.
The service was improperly configured, which prevented it from starting.
Another service (e.g. SQL Server) that this service is dependent on was stopped.
You can attempt to restart the Windows service for the SQL Agent
Name | Description | Default Value |
Alert Priority | Defines Alert Priority. | Normal |
Alert Severity | Defines Alert Severity. | Match monitor’s health |
Alert only if service startup type is automatic | This may only be set to 'true' or 'false'. If set to 'false', then alerts will be triggered no matter what the startup type is. Default is 'true'. | Yes |
Enabled | Enables or disables the workflow. | Yes |
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. | 600 |
Synchronization Time | The synchronization time is specified by using a 24-hour format. Can be omitted. |
|
Timeout (seconds) | Specifies the time the workflow is allowed to run before being closed and marked as failed. | 300 |
Timeout for query execution (seconds) | The workflow will fail and register an event, if the query execution takes longer than the specified period. | 60 |
Timeout for database connection (seconds) | The workflow will fail and register an event, if it cannot access the database during the specified period. | 15 |
Unavailable Time (seconds) | The minimum duration of service unavailability before considering it unhealthy. | 900 |
Target | Microsoft.SQLServer.Windows.Agent | ||
Parent Monitor | System.Health.AvailabilityState | ||
Category | AvailabilityHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | MatchMonitorHealth | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.SQLServer.Windows.MonitorType.SqlServiceStatus | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.SQLServer.Windows.Monitor.Agent.ServiceStatus" Accessibility="Public" Enabled="true" Target="SqlDiscW!Microsoft.SQLServer.Windows.Agent" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.Windows.MonitorType.SqlServiceStatus" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.Windows.Monitor.Agent.ServiceStatus.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Running" HealthState="Success"/>
<OperationalState ID="Warning" MonitorTypeStateID="UnableToDetectStatus" HealthState="Warning"/>
<OperationalState ID="Error" MonitorTypeStateID="NotRunning" HealthState="Error"/>
</OperationalStates>
<Configuration>
<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>
<ConnectionString>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<InstanceVersion>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Version$</InstanceVersion>
<InstanceEdition>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Edition$</InstanceEdition>
<MonitoringType>$Target/Host/Property[Type="SqlDiscW!Microsoft.SQLServer.Windows.DBEngine"]/MonitoringType$</MonitoringType>
<ServiceType>Agent</ServiceType>
<CheckStartupType>true</CheckStartupType>
<UnavailableTime>900</UnavailableTime>
<SqlExecTimeoutSeconds>60</SqlExecTimeoutSeconds>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>300</TimeoutSeconds>
<IntervalSeconds>120</IntervalSeconds>
<SyncTime/>
</Configuration>
</UnitMonitor>