監視 SPF Web 端點和 SPF 資料庫之間的連線。
監視 SPF 網頁伺服器的資料庫連線。方式是定期建立與 Service Provider Foundation 資料庫的測試連線。
如果此監視處於錯誤狀態,則可能是無法從伺服器使用資料庫,或是監視的安全性無法正確設定。請參閱<設定> 一節,瞭解設定監視的詳細資料。
如果監視正確設定,但監視處於錯誤狀態,則可能是資料庫已離線或是 Service Provider Foundation 伺服器無法存取資料庫伺服器。
檢查 Service Provider Foundation 資料庫和資料庫伺服器的狀態。
要讓此監視正確運作,它必須有讀取 Service Management Automation 資料庫的權限。請建立具有資料庫讀取權限的執行身分帳戶,然後將它新增到名為 Microsoft Service Provider Foundation 資料庫帳戶的執行身分設定檔。
您可以在此監視上設定下列選項:
選項 | 定義 | 預設值 |
警示開啟狀態 | 產生警示之監視的健全狀況狀態。 | 監視處於重大的健全狀況狀態 |
警示優先順序 | 此監視所產生之警示的優先順序。 | 高 |
警示嚴重性 | 此監視所產生之警示的優先順序。 | 重大 |
自動解決警示 | 指定當監視恢復狀況良好狀態時,是否應自動解除警示。 | True |
已啟用 | 指定監視是否應執行。 | True |
產生警示 | 指定當變更為警告或重大狀態時,監視是否應產生警示。 | True |
間隔 | 執行監視的間隔秒數。 | 300 |
Target | Microsoft.SystemCenter.SPF.SpfServer | ||
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.SystemCenter.ServiceProviderFoundation.PowerShellModule.TwoStateMonitorType.PropertyBag | ||
Remotable | True | ||
Accessibility | Internal | ||
Alert Message |
| ||
RunAs | Microsoft.SystemCenter.SPF.DatabaseAccount |
<UnitMonitor ID="Microsoft.SystemCenter.SPF.Monitor.SpfDatabaseScriptMonitor" Accessibility="Internal" Enabled="true" Target="Microsoft.SystemCenter.SPF.SpfServer" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.SystemCenter.ServiceProviderFoundation.PowerShellModule.TwoStateMonitorType.PropertyBag" ConfirmDelivery="false" RunAs="Microsoft.SystemCenter.SPF.DatabaseAccount">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SystemCenter.SPF.Monitor.SpfDatabaseScriptMonitor.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>300</IntervalSeconds>
<SyncTime/>
<ScriptName>HealthOfSqlServer.ps1</ScriptName>
<ScriptBody> $oAPI = new-object -comObject "MOM.ScriptAPI"
$propertyBag = $oAPI.CreatePropertyBag()
$errorActionSetting = $ErrorActionPreference
try
{
$ErrorActionPreference = "Stop"
Import-Module "$env:COMMONPROGRAMFILES\Microsoft System Center 2012 R2\Service Provider Foundation\Microsoft.SystemCenter.Foundation.Cmdlet.dll"
$stamps = Get-SCSPFStamp
$propertyBag.AddValue("Result", "Success")
}
catch
{
$propertyBag.AddValue("Result", "Error")
}
finally
{
$ErrorActionPreference = $errorActionSetting
$propertyBag
}
</ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
<ErrorExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='Result']</XPathQuery>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value Type="String">Success</Value>
</ValueExpression>
</SimpleExpression>
</ErrorExpression>
<SuccessExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='Result']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Success</Value>
</ValueExpression>
</SimpleExpression>
</SuccessExpression>
</Configuration>
</UnitMonitor>