Monitors the CPU utilization on the parent partition
This monitor tracks the CPU performance of the host. The CPU usage has exceeded the threshold.
The virtual machines and parent partition workloads running on the host are consuming critical levels of the CPU resources on the host.
Either migrate virtual machines to a different host or reduce parent partition workload CPU consumption. To have Virtual Machine Manger automatically balance host clusters, enable dynamic optimization. For more information about dynamic optimization, see the Virtual Machine Manager documentation.
Target | Microsoft.SystemCenter.VirtualMachineManager.2012.HyperVHost | ||
Parent Monitor | System.Health.AvailabilityState | ||
Category | Custom | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | MatchMonitorHealth | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.SystemCenter.VirtualMachineManager.2012.Performance.ScriptBasedConsecutiveSamplesTwoThresholdsMonitorType | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.SystemCenter.VirtualMachineManager.2012.HostParentPartitionCPUUtilizationMonitor" Accessibility="Public" Target="VMM2012Discovery!Microsoft.SystemCenter.VirtualMachineManager.2012.HyperVHost" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" TypeID="Microsoft.SystemCenter.VirtualMachineManager.2012.Performance.ScriptBasedConsecutiveSamplesTwoThresholdsMonitorType">
<Category>Custom</Category>
<AlertSettings AlertMessage="Microsoft.SystemCenter.VirtualMachineManager.2012.HostParentPartitionCPUUtilizationMonitor.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter1>
<AlertParameter2>$Data/Context/SampleValue$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="CPUUtilizationReachedWarning" MonitorTypeStateID="ConditionWarn" HealthState="Warning"/>
<OperationalState ID="CPUUtilizationReachedError" MonitorTypeStateID="ConditionError" HealthState="Error"/>
<OperationalState ID="CPUUtilizationIsSuccess" MonitorTypeStateID="ConditionSuccess" HealthState="Success"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>180</IntervalSeconds>
<TimeoutSeconds>180</TimeoutSeconds>
<WarningThreshold>80</WarningThreshold>
<CriticalThreshold>90</CriticalThreshold>
<NumSamples>3</NumSamples>
<Arguments>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</Arguments>
<ScriptBody>
' Copyright (c) Microsoft Corporation. All rights reserved.
' VBScript source code
' HostParentPartitionCPUUtilizationProvider.vbs
Option Explicit
SetLocale("en-us")
' This Script is used to check the Host Parent partition CPU utilization
' Alert when the utilization of this partition is high:
' Warning: WarningThreshold%, like 80%
' Critical: CriticalThreshold, like 90%
Dim oArgs, hostComputerName, objWMIService, colItems, objItem, performanceUtilization
Dim oAPI, oBag
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oArgs = Wscript.Arguments
' Check to see if the required script arguments are there
' 1 argument is requried
' If 1 argument does not exist, log a script event
If oArgs.Count = 1 Then
hostComputerName = oArgs(0)
Set oBag = oAPI.CreatePropertyBag()
Set objWMIService = GetObject("winmgmts:\\" & hostComputerName & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("Select * from win32_PerfFormattedData_Perfos_Processor where name = '_Total'")
for each objItem in colItems
performanceUtilization = objItem.PercentProcessorTime
Next
performanceUtilization = CInt(performanceUtilization)
Call oBag.AddValue("Utilization", performanceUtilization)
Call oBag.AddValue("WarningThreshold", 80)
Call oAPI.LogScriptEvent("HostParentCPUUtilizationCounter.vbs", 101, 0, "HostParentCPUUtilizationCounter is " & performanceUtilization)
Call oAPI.Return(oBag)
Else
Call oAPI.LogScriptEvent("HostParentCPUUtilizationCounter.vbs", 101, 0, "HostParentCPUUtilizationCounter was not called with 1 argument and was not executed.")
End If
</ScriptBody>
<ObjectName>win32_PerfFormattedData_Perfos_Processor</ObjectName>
<CounterName>PercentProcessorTime</CounterName>
<InstanceName>_Total</InstanceName>
<Value>$Data/Property[@Name='Utilization']$</Value>
</Configuration>
</UnitMonitor>