Service Provider Foundation VMM server monitor

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

Monitors the connection to all registered VMM servers.

Knowledge Base article:

Summary

Monitors VMM management server connectivity from the SPF web servers. This is done by periodically making a test connection to each of the registered VMM management servers.

Configuration

For this monitor to work correctly, it must have permission to execute SPF PowerShell Cmdlets and connectivity to VMM server. Create a Run As Account that uses or has equal permission as the App Pool account specified for the VMM web endpoint and add it to the Run As Profile called Microsoft Service Provider Foundation VMM Account.

Option

Definition

Default

Alert On State

Health state for the monitor that generates an alert.

The monitor is in a critical health state

Alert Priority

Priority of the alert generated for this monitor.

High

Alert Severity

Priority of the alert generated for this monitor.

Critical

Auto-Resolve Alert

Specifies whether the alert should automatically be resolved when the monitor returns to a healthy state.

True

Enabled

Specifies whether the monitor should run.

True

Generates Alert

Specifies whether the monitor should generate an alert when changing to a warning or critical state.

True

Interval

Number of seconds between times that the monitor is run.

300

Causes

If this monitor is in error, then either the VMM management server is not available from the server, or the VMM management server configuration has changed, or the security for the monitor is not configured correctly. See the Configuration section for details on configuring the monitor.

If the monitor is configured correctly and the monitor is in error then the VMM management server is offline or is inaccessible to the Service Provider Foundation server.

Resolutions

Check the VMM management server configuration, for port number, accounts permission, and operation state using VMM monitoring management pack. If VMM operating state indicate no errors, check the registered VMM servers in SPF database to ensure the connection information is correct. Verify the Application Pool account for the VMM web endpoint on the SPF server is provisioned with access to the VMM server. Check the App Pool account password for expiration.

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
Cannot Connect To VMM
Connection to registered VMM server was unsuccessful
RunAsMicrosoft.SystemCenter.SPF.DatabaseAccount

Source Code:

<UnitMonitor ID="Microsoft.SystemCenter.SPF.Monitor.VMMServerConnection" 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.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 = ""

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.Length -gt 0)
{
$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>