Service Provider Foundation VMM Web 端點監視器

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

監視 SPF VMM Web 端點的操作健康情況。

Knowledge Base article:

摘要

檢查是否可從 SPF Web 伺服器存取 VMM Web 執行個體,以及 VMM Web 執行個體是否正確運作。這是透過定期建立測試 Web 介面呼叫以抓取雲端資源來完成。

設定

此監視器必須有可存取 VMM 伺服器上雲端資源的系統管理員權限才能正確運作。建立使用為 VMM Web 端點指定之「應用程式集區」帳戶或具有同等權限的「執行身分帳戶」,並將它新增到名為「Microsoft Service Provider Foundation VMM 帳戶」的「執行身分設定檔」。

您可以在此監視器上設定下列選項:

選項

定義

預設值

警示開啟狀態

產生警示之監視器的健康情況狀態。

監視器處於重大的健康情況狀態

警示優先順序

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

警示嚴重性

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

重大

自動解決警示

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

True

已啟用

指定監視器是否應該執行。

True

產生警示

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

True

間隔

監視器執行的間隔秒數。

300

原因

若此監視器處於錯誤狀態,而且沒有任何其他連線監視器處於錯誤狀態,則可能是網狀架構設定錯誤或權限錯誤。如需設定監視器的詳細資訊,請參閱<設定>一節。

解決方式

針對雲端資源上的網狀架構設定檢查目標 VMM 伺服器,並確定已將存取權限授與系統管理員帳戶。確定已正確設定監視器的安全性。

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
AccessibilityPublic
Alert Message
無法存取 VMM 端點
無法存取 Service Provider Foundation VMM Web 端點。
RunAsMicrosoft.SystemCenter.SPF.VmmEndpointAccount

Source Code:

<UnitMonitor ID="Microsoft.SystemCenter.SPF.Monitor.VMMEndpointGet" 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.VmmEndpointAccount">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SystemCenter.SPF.Monitor.VMMEndpointGet.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Property[@Name='StatusCode']$</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>HealthOfSpfServer.ps1</ScriptName>
<ScriptBody><Script>param
(
$PortNumber
)

$oAPI = new-object -comObject "MOM.ScriptAPI"
$propertyBag = $oAPI.CreatePropertyBag()

$errorActionSetting = $ErrorActionPreference

$downVmmServers = ""
$res = $null

try
{
$ErrorActionPreference = "Stop"

[Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}

$req = [System.Net.WebRequest]::Create("https://localhost:$PortNumber/SC2012R2/VMM/Microsoft.Management.OData.svc/Clouds")
$req.UseDefaultCredentials = $true
$res = $req.GetResponse()
$int = [int]$res.StatusCode
if($int -eq 200)
{
$propertyBag.AddValue("Result", "Success")
}
else
{
$propertyBag.AddValue("Result", "Failure")
}

$propertyBag.AddValue("StatusCode", $int)

}
catch
{
$propertyBag.AddValue("Result", "Failure")
$propertyBag.AddValue("StatusCode", $_.Exception.Message)
}
finally
{
$ErrorActionPreference = $errorActionSetting
if($res -ne $null)
{
$res.Close()
}
$propertyBag
}
</Script></ScriptBody>
<Parameters>
<Parameter>
<Name>PortNumber</Name>
<Value>$Target/Property[Type="Microsoft.SystemCenter.SPF.SpfServerBase"]/PortNumber$</Value>
</Parameter>
</Parameters>
<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>