icinga-powershell-framework/modules/include/hardware/cpu.ps1
2018-11-06 17:14:49 +01:00

19 lines
No EOL
598 B
PowerShell

param($Config = $null);
#
# Fetch the CPU Hardware informations
#
# Lets load some additional CPU informations, besides current performance counters
# It might be useful to get more details about the hardware itself
$CPUInformations = Get-CimInstance Win32_Processor;
[hashtable]$PhysicalCPUData = @{};
foreach ($cpu_properties in $CPUInformations) {
$cpu_datails = @{};
foreach($cpu_core in $cpu_properties.CimInstanceProperties) {
$cpu_datails.Add($cpu_core.Name, $cpu_core.Value);
}
$PhysicalCPUData.Add($cpu_datails.DeviceID, $cpu_datails);
}
return $PhysicalCPUData;