Monitor połączenia z bazą danych programu Service Provider Foundation

Microsoft.SystemCenter.SPF.Monitor.SpfDatabaseScriptMonitor (UnitMonitor)

Monitoruje połączenie między punktem końcowym sieci Web programu SPF a bazą danych programu SPF.

Knowledge Base article:

Podsumowanie

Monitoruje łączność serwerów sieci Web programu SPF z bazą danych. Jest to realizowane poprzez okresowe nawiązywanie połączenia testowego z bazą danych programu Service Provider Foundation.

Przyczyny

Wystąpienie błędu w tym monitorze oznacza, że baza danych jest niedostępna z serwera lub zabezpieczenia monitora nie są poprawnie skonfigurowane. Szczegóły konfigurowania monitora można znaleźć w sekcji Konfiguracja.

Wystąpienie błędu w poprawnie skonfigurowanym monitorze oznacza, że baza danych jest w trybie offline lub jej serwer jest niedostępny dla serwera programu Service Provider Foundation.

Rozwiązanie

Sprawdź stan bazy danych programu Service Provider Foundation i jej serwera.

Konfiguracja

Aby ten monitor działał poprawnie, musi mieć uprawnienie do odczytu bazy danych programu Service Management Automation. Utwórz konto Uruchom jako z uprawnieniami do odczytu bazy danych, a następnie dodaj je do profilu Uruchom jako o nazwie „Konto bazy danych programu Microsoft Service Provider Foundation”.

W tym monitorze można skonfigurować następujące opcje:

Opcja

Definicja

Domyślne

Stan włączenia alertu

Stan kondycji monitora generujący alert.

Monitor wskazuje krytyczny stan kondycji

Priorytet alertu

Priorytet alertu generowanego dla tego monitora.

Wysoki

Ważność alertu

Priorytet alertu generowanego dla tego monitora.

Krytyczny

Automatyczne rozwiązywanie alertu

Określa, czy alert powinien zostać rozwiązany automatycznie po powrocie monitora do stanu prawidłowego.

Prawda

Włączone

Określa, czy monitor powinien zostać uruchomiony.

Prawda

Generuje alert

Określa, czy monitor powinien generować alert po przejściu w stan ostrzeżenia lub w stan krytyczny.

Prawda

Interwał

Liczba sekund między uruchomieniami monitora.

300

Element properties:

TargetMicrosoft.SystemCenter.SPF.SpfServer
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SystemCenter.ServiceProviderFoundation.PowerShellModule.TwoStateMonitorType.PropertyBag
RemotableTrue
AccessibilityInternal
Alert Message
AlertIfCantConnectToSpfDatabase
Nie powiodło się nawiązanie połączenia z bazą danych programu SPF.
RunAsMicrosoft.SystemCenter.SPF.DatabaseAccount

Source Code:

<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><Script>$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
}
</Script></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>