監視 SPF Web 端點與 SPF 資料庫之間的連線。
監視來自 SPF Web 伺服器的資料庫連線。這是透過定期測試與 Service Provider Foundation 資料庫的連線來完成。
此監視器必須有讀取「服務管理自動化」資料庫的權限才能正確運作。建立具有讀取資料庫之權限的「執行身分資料庫」,將它新增到名為「Microsoft Service Provider Foundation 資料庫帳戶」的「執行身分設定檔」。
您可以在此監視器上設定下列選項:
選項 | 定義 | 預設值 |
警示開啟狀態 | 產生警示之監視器的健康情況狀態。 | 監視器處於重大的健康情況狀態 |
警示優先順序 | 此監視器所產生之警示的優先順序。 | 高 |
警示嚴重性 | 此監視器所產生之警示的優先順序。 | 重大 |
自動解決警示 | 指定當監視器恢復到狀況良好狀態時,是否應該自動解除警示。 | True |
已啟用 | 指定監視器是否應該執行。 | True |
產生警示 | 指定當變更為警告或重大狀態時,監視器是否應該產生警示。 | True |
間隔 | 監視器執行的間隔秒數。 | 300 |
若此監視器處於錯誤狀態,表示伺服器無法存取資料庫,或未正確設定監視器的安全性。如需設定監視器的詳細資訊,請參閱<設定>一節。
若監視器已正確設定且監視器處於錯誤狀態,表示資料庫已離線或 Service Provider Foundation 伺服器無法存取資料庫伺服器。
檢查 Service Provider Foundation 資料庫與資料庫伺服器的狀態。
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 | Public | ||
Alert Message |
| ||
RunAs | Microsoft.SystemCenter.SPF.DatabaseAccount |
<UnitMonitor ID="Microsoft.SystemCenter.SPF.Monitor.SpfDatabaseScriptMonitor" Accessibility="Public" 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>