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

27 lines
878 B
PowerShell
Raw Normal View History

2019-07-25 12:29:21 -04:00
function Get-IcingaMemoryPerformanceCounter()
{
$MemoryStart = (Show-IcingaPerformanceCounters -CounterCategory 'Memory');
2019-07-25 12:29:21 -04:00
$MemoryCounter = New-IcingaPerformanceCounterArray -Counter $MemoryStart;
[hashtable]$Result = @{};
foreach ($item in $MemoryCounter.Keys) {
$counter = $item.trimstart('\Memory\');
$Result.Add($counter, $MemoryCounter[$item]);
}
return $Result;
}
function Get-IcingaPageFilePerformanceCounter()
{
$PageFileStart = (Show-IcingaPerformanceCounters -CounterCategory 'Paging File');
$PageFileCounter = New-IcingaPerformanceCounterArray -Counter $PageFileStart;
[hashtable]$Result = @{};
foreach ($item in $PageFileCounter.Keys) {
$counter = $item.trimstart('\Paging File\');
$Result.Add($counter, $PageFileCounter[$item]);
}
return $Result;
}