System Center 2019+ Virtual Machine Manager Geheugengebruik op host

Microsoft.SystemCenter.VirtualMachineManager.HostMemoryUtilizationMonitor (UnitMonitor)

Hiermee wordt het geheugengebruik op de host bewaakt

Knowledge Base article:

Samenvatting

Deze monitor houdt bij hoeveel geheugen op de host wordt gebruikt (in MB). Het beschikbare geheugen voor de host ligt onder de drempelwaarde.

Oorzaken

De virtuele machines op de host verbruiken kritieke niveaus aan hostgeheugen.

Oplossingen

Migreer een virtuele machine naar een andere host om extra hostgeheugen vrij te maken U kunt de taakverdeling van hostclusters ook automatisch optimaliseren met Virtual Machine Manager door dynamische optimalisatie in te schakelen. Raadpleeg de documentatie bij Virtual Machine Manager voor meer informatie over dynamische optimalisatie.

Element properties:

TargetMicrosoft.SystemCenter.VirtualMachineManager.Discovery.HyperVHost
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SystemCenter.VirtualMachineManager.Performance.PowershellBasedConsecutiveSamplesTwoThresholdsMonitorType
RemotableTrue
AccessibilityPublic
Alert Message
Geheugengebruik op host hoog
Het geheugengebruik op de host is {1} en heeft de niveaus Waarschuwing en Kritiek overschreden voor {0}
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SystemCenter.VirtualMachineManager.HostMemoryUtilizationMonitor" Accessibility="Public" Target="VMMDiscovery!Microsoft.SystemCenter.VirtualMachineManager.Discovery.HyperVHost" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" TypeID="Microsoft.SystemCenter.VirtualMachineManager.Performance.PowershellBasedConsecutiveSamplesTwoThresholdsMonitorType">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SystemCenter.VirtualMachineManager.HostMemoryUtilizationMonitor.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="MemoryUtilizationReachedWarning" MonitorTypeStateID="ConditionWarn" HealthState="Warning"/>
<OperationalState ID="MemoryUtilizationReachedError" MonitorTypeStateID="ConditionError" HealthState="Error"/>
<OperationalState ID="MemoryUtilizationIsSuccess" MonitorTypeStateID="ConditionSuccess" HealthState="Success"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>180</IntervalSeconds>
<TimeoutSeconds>180</TimeoutSeconds>
<WarningThreshold>90</WarningThreshold>
<CriticalThreshold>95</CriticalThreshold>
<NumSamples>3</NumSamples>
<hostComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</hostComputerName>
<ScriptBody><Script># Copyright (c) Microsoft Corporation. All rights reserved.
# Powershell source code
# HostMemoryUtilizationCounter.ps1

# This Script is used to check the Host memory utilization
# Alert when the utilization of this partition is high:
# Warning: WarningThreshold%, like 80%
# Critical: CriticalThreshold, like 90%

param($hostComputerName)

$momAPI = new-object -comObject MOM.ScriptAPI
$error.Clear();
$oBag = $momAPI.CreatePropertyBag();

$colItems = gcim Win32_OperatingSystem;

foreach($objItem in $colItems){
if($objItem.TotalVisibleMemorySize -gt 0){
$performanceUtilization = (($objItem.TotalVisibleMemorySize - $objItem.FreePhysicalMemory)/$objItem.TotalVisibleMemorySize)*100;
}
}

if($performanceUtilization -lt 0){
$performanceUtilization = 0;
}

$performanceUtilization = [int]$performanceUtilization;

$oBag.AddValue("Utilization",$performanceUtilization);
$oBag;</Script></ScriptBody>
<ObjectName>win32_PerfFormattedData_Perfos_Memory</ObjectName>
<CounterName>PercentCommittedBytesInUse</CounterName>
<InstanceName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</InstanceName>
<Value>$Data/Property[@Name='Utilization']$</Value>
</Configuration>
</UnitMonitor>