(imported topic written by RolfWilhelm)
Dear all,
I had some days ago the issue to retrieve information about the number of CPU sockets and number of cores in a server. Goal was to check if Windows Server Enterprise Edition is installed on hardware, which requires this license or not or vice versa to see if a Windows Server Standard Edition is installed on a hardware which requires Enterprise Edition.
I found the relevance clauses “physical processor count” and “number of processors”, but found them not working properly at least on Windows Server 2012 and 2008R2 - while Powershell and Taskmanager were showing 4 sockets, 6 cores per socket and hyperthreading enabled, TEM showed “3 physical processors” (instead of 4) and “30 processors” (instead of 48). And I was still not able to detect the number of real cores independantly of hyperthreading. Used version is TEM 8.2 with agent version 8.2.1409 - if somebody can confirm that this has been solved in v9 or not will be appreciated.
So, here is now a working solution based on WMI, which takes some time, but delivers correct data:
CPU_Socket:
if Windows of Operating system then (String value of (select “NumberOfProcessors from Win32_ComputerSystem” of wmi)) else (number of processors) as string
CPU_Core:
if Windows of Operating system then ((integer value of (select “NumberOfCores from Win32_Processor where DeviceID=‘CPU0’” of wmi)) * (integer value of (select “NumberOfProcessors from Win32_ComputerSystem” of wmi))) as string else (number of processors) as string
CPU_Hyperthreading:
if Windows of Operating system then if ((integer value of (select “NumberOfCores from Win32_Processor where DeviceID=‘CPU0’” of wmi))=(integer value of (select “NumberOfLogicalProcessors from Win32_Processor where DeviceID=‘CPU0’” of wmi))) then “No” else “Yes” else “”
Due to the fact that using WMI always costs a lot of CPU performance and that HW does not change that often, but in case you perform an upgrade you also want to see the result not too far in the future, I have set the refresh period to 1 day.
Regards,
Rolf.