SQL Server Agent 服務

Microsoft.SQLServer.Linux.Monitor.Agent.ServiceStatus (UnitMonitor)

此監視器會檢查此 SQL Server 執行個體的 SQL Agent 服務狀態。
請注意,所有版本的 SQL Server Express 皆不支援 SQL Server Agent Windows 服務。

Knowledge Base article:

摘要

此監視器會檢查 SQL Agent 服務的狀態,在該服務設定為自動啟動但卻未執行時產生警示。

請注意,停用此服務時,不會產生警示 - 將會顯示狀況良好的狀態。

原因

服務可能會因許多原因而停止,其中包括:

解決方式

您可嘗試為 SQL Agent 重新啟動 Linux 服務

可覆寫的參數

名稱

描述

預設值

警示優先順序

定義警示優先順序。

標準

警示嚴重性

定義警示嚴重性。

MatchMonitorHealth

只有服務啟動類型為自動時才會發出警示

其只可設定為 'true' 或 'false'。如果設定為 'false',則不論啟動類型設定為何,都會觸發警示。預設值為 'true'。

已啟用

啟用或停用該工作流程。

產生警示

定義工作流程是否要產生警示。

間隔 (秒)

每次重複執行工作流程之間的時間間隔 (秒)。

600

同步處理時間

同步處理時間使用 24 小時制。可予省略。

 

逾時 (秒)

指定流程被關閉及標示為失敗之前,允許執行的時間。

300

資料庫連線的逾時 (秒)

若工作流程無法在指定的期限之內存取資料庫,將會失敗並登錄一則事件。

15

Element properties:

TargetMicrosoft.SQLServer.Linux.Agent
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.Linux.MonitorType.SqlServiceStatus
RemotableTrue
AccessibilityPublic
Alert Message
Linux 上的 MSSQL: SQL Server 代理程式 Linux 服務已停止
電腦 "{0}" 上已停止之 SQL Server 執行個體 "{1}" 其 SQL Server Agent 的 Linux 服務
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.Linux.Monitor.Agent.ServiceStatus" Accessibility="Public" Enabled="true" Target="SqlDiscL!Microsoft.SQLServer.Linux.Agent" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.Linux.MonitorType.SqlServiceStatus" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.Linux.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>
<ServiceType>Agent</ServiceType>
<CheckStartupType>true</CheckStartupType>
<UnavailableTime>900</UnavailableTime>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>300</TimeoutSeconds>
<IntervalSeconds>600</IntervalSeconds>
<SyncTime/>
</Configuration>
</UnitMonitor>