mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Fix Physical Memory Size Count
Fixes #13 by using a proper CimInstance Object for returning the total physical memory size on the host
This commit is contained in:
parent
09e406b90c
commit
4e995390a4
1 changed files with 2 additions and 3 deletions
|
|
@ -23,9 +23,8 @@ function ClassMemory
|
|||
);
|
||||
|
||||
# Lets load some additional memory informations, besides current performance counters
|
||||
$MemoryInformations = Get-CimInstance Win32_PhysicalMemory;
|
||||
$capacity = $MemoryInformations | Measure-Object -Property capacity -Sum;
|
||||
$counter.Add('\Memory\Physical Memory Total Bytes', @{ 'value' = $capacity.Sum; 'sample' = @{ }; });
|
||||
$ComputerInformations = Get-CimInstance Win32_ComputerSystem;
|
||||
$counter.Add('\Memory\Physical Memory Total Bytes', @{ 'value' = $ComputerInformations.TotalPhysicalMemory; 'sample' = @{ }; });
|
||||
|
||||
return $counter;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue