icinga-powershell-framework/lib/provider/memory/Get-IcingaMemoryUsage.psm1

15 lines
566 B
PowerShell
Raw Normal View History

2019-07-25 12:31:08 -04:00
function Get-IcingaMemoryUsage()
{
$MEMUsageInformations = Get-CimInstance Win32_OperatingSystem;
[hashtable]$MEMUsageData = @{
'FreePhysicalMemory' = $MEMUsageInformations.FreePhysicalMemory;
'FreeVirtualMemory' = $MEMUsageInformations.FreeVirtualMemory;
'TotalVirtualMemorySize' = $MEMUsageInformations.TotalVirtualMemorySize;
'TotalVisibleMemorySize' = $MEMUsageInformations.TotalVisibleMemorySize;
'MaxProcessMemorySize' = $MEMUsageInformations.MaxProcessMemorySize;
}
return $MEMUsageData;
}