How to determine the Number of Processors, Cores and Sockets
There is currently no OOTB solution at the time of this writing, but for now, you have two options:
1) If the servers are discovered via vCenter
We created this Report within BOXI's WEBI to get you vCenter details in a Table format for easy filtering Copy the vCenterParameterReport.wid file onto you BOXI Server and double click it. Once you log in, click "Refresh Data" on the Top right and enter the full component name of the vCenter Blueprint as well as the Servername for the vCenter as it appears in CCA (FQDN or not)
2) If the servers are not discovered by vCenter (or have, but still want to use the below method)
They can modify an existing blueprint (copy)(I usually recommend the Hardware Details) or create a new one that contains **Please ensure you remove any character returns when copying the below scripts**
SOLARIS:
Number of CPUs
kstat cpu_info | grep core_id | uniq | wc -l | tr -d ' '
Number of Cores
kstat cpu_info | grep cpu_info | grep instance | wc -l | tr -d ' '
Number of Cores Per CPU
cpus=`kstat cpu_info | grep core_id | uniq | wc -l | tr -d ' '`; cores=`kstat cpu_info | grep cpu_info | grep instance | wc -l | tr -d ' '`; cpuspercore=`expr $cores / $cpus`; echo $cpuspercore
LINUX
Number of CPUs
lscpu | grep "^CPU(s):"
Number of Sockets
lscpu | grep "Socket(s)"
Number of Cores Per Socket
lscpu | grep "Core(s) per socket"
Output Format
Use Name Colon Value parser for the Linux Commands
WINDOWS
CPU Physical Count
echo On Error Resume Next >__TMP__.vbs __NL__ echo strComputer = "." >>__TMP__.vbs __NL__ echo Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") >>__TMP__.vbs __NL__ echo Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem") >>__TMP__.vbs __NL__ echo For Each objItem in colItems >>__TMP__.vbs __NL__ echo Wscript.Echo "CPU Physical Count : " & Trim(objItem.NumberOfProcessors) >>__TMP__.vbs __NL__ echo Next >>__TMP__.vbs __NL__ cscript //Nologo __TMP__.vbs && del __TMP__.vbs
CPU Logical Count
echo On Error Resume Next >__TMP__.vbs __NL__ echo strComputer = "." >>__TMP__.vbs __NL__ echo Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") >>__TMP__.vbs __NL__ echo Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor") >>__TMP__.vbs __NL__ echo For Each objItem in colItems >>__TMP__.vbs __NL__ echo Wscript.Echo "CPU Logical Count : " & Trim(objItem.NumberOfLogicalProcessors) >>__TMP__.vbs __NL__ echo Next >>__TMP__.vbs __NL__ cscript //Nologo __TMP__.vbs && del __TMP__.vbs
CPU Core Count
echo On Error Resume Next >__TMP__.vbs __NL__ echo strComputer = "." >>__TMP__.vbs __NL__ echo Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") >>__TMP__.vbs __NL__ echo Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor") >>__TMP__.vbs __NL__ echo For Each objItem in colItems >>__TMP__.vbs __NL__ echo Wscript.Echo "CPU Core Count : " & Trim(objItem.NumberOfCores) >>__TMP__.vbs __NL__ echo Next >>__TMP__.vbs __NL__ cscript //Nologo __TMP__.vbs && del __TMP__.vbs
Output Format
Use Tabular Parser the Windows Scripts outputs