Service Provider Foundation VMM 伺服器監視

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

監視所有已登錄之 VMM 伺服器的連線。

Knowledge Base article:

摘要

監視 SPF 網頁伺服器的 VMM 管理伺服器連線。方式是定期建立與每部已登錄 VMM 管理伺服器的測試連線。

原因

如果此監視處於錯誤狀態,則可能是無法從伺服器使用 VMM 管理伺服器、VMM 管理伺服器設定已變更,或是監視的安全性未正確設定。請參閱<設定> 一節,瞭解設定監視的詳細資料。

如果監視正確設定,但監視處於錯誤狀態,則可能是 VMM 管理伺服器已離線或是 Service Provider Foundation 伺服器無法存取 VMM 管理伺服器。

解決方式

使用 VMM 監視管理組件檢查 VMM 管理伺服器設定中的連接埠號碼、帳戶權限和操作狀態。如果 VMM 操作狀態未指出任何問題,請檢查 SPF 資料庫中已登錄的 VMM 伺服器,確認連線資訊是否正確。請確認是否已提供 VMM 伺服器的存取權給 SPF 伺服器上 VMM Web 端點的應用程式集區帳戶。請檢查應用程式集區帳戶密碼是否已到期。

設定

要讓此監視正確運作,它必須有執行 SPF PowerShell 指令程式的權限以及連線到 VMM 伺服器的能力。請建立執行身分帳戶,讓此帳戶使用或擁有與指定給 VMM Web 端點之應用程式帳戶相同的權限,並將它新增到名為 Microsoft Service Provider Foundation VMM 帳戶的執行身分設定檔。

選項

定義

預設值

警示開啟狀態

產生警示之監視的健全狀況狀態。

監視處於重大的健全狀況狀態

警示優先順序

此監視所產生之警示的優先順序。

警示嚴重性

此監視所產生之警示的優先順序。

重大

自動解決警示

指定當監視恢復狀況良好狀態時,是否應自動解除警示。

True

已啟用

指定監視是否應執行。

True

產生警示

指定當變更為警告或重大狀態時,監視是否應產生警示。

True

間隔

執行監視的間隔秒數。

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
AlertIfCantConnectToVMM
連線到已登錄的 VMM 伺服器失敗
RunAsMicrosoft.SystemCenter.SPF.DatabaseAccount

Source Code:

<UnitMonitor ID="Microsoft.SystemCenter.SPF.Monitor.VMMServerConnection" 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.VMMServerConnection.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Property[@Name='DownVmmServers']$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>300</IntervalSeconds>
<SyncTime/>
<ScriptName>HealthOfVmmServers.ps1</ScriptName>
<ScriptBody><Script>$oAPI = new-object -comObject "MOM.ScriptAPI"
$propertyBag = $oAPI.CreatePropertyBag()

$errorActionSetting = $ErrorActionPreference

$downVmmServers = $null

try
{
$ErrorActionPreference = "Stop"
Import-Module "$env:COMMONPROGRAMFILES\Microsoft System Center 2012 R2\Service Provider Foundation\Microsoft.SystemCenter.Foundation.Cmdlet.dll"
$vmmInstallPath = get-itemproperty "hklm:\software\microsoft\microsoft system center virtual machine manager administrator console\setup" | select-object -ExpandProperty installpath
Import-Module "$vmmInstallPath\bin\Microsoft.SystemCenter.VirtualMachineManager.dll"
$servers = Get-SCSPFServer -ServerType 0
foreach($server in $servers)
{
try
{
$vmmServer = Get-SCVmmServer -ComputerName $server
$vmmServer.Disconnect()
$vmmServer = $null
}
catch
{
$downVmmServers = $downVmmServers + "$server;"
}
}

if($downVmmServers -ne $null)
{
$propertyBag.AddValue("Result", "Error")
$propertyBag.AddValue("DownVmmServers", $downVmmServers)
}
else
{
$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>