Jump to content


thekurgan1536

Cores & Processor Count Report

Recommended Posts

Hi guys,

 

I've been tasked with trying to create a report that counts number of cores and logical processors. Using the info from here http://www.madanmohan.com/2012/11/get-number-of-cores-and-logical.html, I have added the following to the bottom of the sms_def.mof file after making a backup of it:

 

[ SMS_Report (TRUE),
SMS_Group_Name ("Processor_Addtl"),
SMS_Class_ID ("CUSTOM|Processor_Addtl|1.0")]

class win32_processor : SMS_Class_Template
{
[sMS_Report (FALSE) ] uint16 AddressWidth;
[sMS_Report (FALSE) ] uint16 Architecture;
[sMS_Report (FALSE) ] uint16 Availability;
[sMS_Report (FALSE) ] string Caption;
[sMS_Report (FALSE) ] uint32 ConfigManagerErrorCode;
[sMS_Report (FALSE) ] boolean ConfigManagerUserConfig;
[sMS_Report (FALSE) ] uint16 CpuStatus;
[sMS_Report (FALSE) ] uint32 CurrentClockSpeed;
[sMS_Report (FALSE) ] uint16 CurrentVoltage;
[sMS_Report (FALSE) ] uint16 DataWidth;
[sMS_Report (FALSE) ] string Description;
[sMS_Report (TRUE), key ] string DeviceID;
[sMS_Report (FALSE) ] boolean ErrorCleared;
[sMS_Report (FALSE) ] string ErrorDescription;
[sMS_Report (FALSE) ] uint32 ExtClock;
[sMS_Report (FALSE) ] uint16 Family;
[sMS_Report (FALSE) ] datetime InstallDate;
[sMS_Report (FALSE) ] uint32 L2CacheSize;
[sMS_Report (FALSE) ] uint32 L2CacheSpeed;
[sMS_Report (FALSE) ] uint32 LastErrorCode;
[sMS_Report (FALSE) ] uint16 Level;
[sMS_Report (FALSE) ] uint16 LoadPercentage;
[sMS_Report (FALSE) ] string Manufacturer;
[sMS_Report (FALSE) ] uint32 MaxClockSpeed;
[sMS_Report (FALSE) ] string Name;
[sMS_Report (TRUE) ] uint32 NumberOfCores;
[sMS_Report (TRUE) ] uint32 NumberOfLogicalProcessors;
[sMS_Report (FALSE) ] string OtherFamilyDescription;
[sMS_Report (FALSE) ] string PNPDeviceID;
[sMS_Report (FALSE) ] uint16 PowerManagementCapabilities[];
[sMS_Report (FALSE) ] boolean PowerManagementSupported;
[sMS_Report (FALSE) ] string ProcessorId;
[sMS_Report (FALSE) ] uint16 ProcessorType;
[sMS_Report (FALSE) ] uint16 Revision;
[sMS_Report (FALSE) ] string Role;
[sMS_Report (FALSE) ] string SocketDesignation;
[sMS_Report (FALSE) ] string Status;
[sMS_Report (FALSE) ] uint16 StatusInfo;
[sMS_Report (FALSE) ] string Stepping;
[sMS_Report (FALSE) ] string SystemName;
[sMS_Report (FALSE) ] string UniqueId;
[sMS_Report (FALSE) ] uint16 UpgradeMethod;
[sMS_Report (FALSE) ] string Version;
[sMS_Report (FALSE) ] uint32 VoltageCaps;
};

 

I did a mofcomp on the sms_def.mof file afterwards. I'm trying to build the report using the report syntax on that link but it clearly doesn't find the Processor_Addtl table. Is there a step I am failing to complete in my ineptness? What other steps do I need to do to have this show in say sql server to test the data?

 

SELECT
SYS.Netbios_Name0,
Processor.Name0,
Processor.NormSpeed0 as [CPU Speed],
Processor.DeviceID0,
ProcAddtl.NumberOfCores0 as [Number of Cores],
ProcAddtl.NumberOfLogicalProcessors0 as [Number of Logical Processors]
FROM v_R_System SYS
JOIN v_GS_PROCESSOR Processor on SYS.ResourceID=Processor.ResourceID
left join v_gs_Processor_Addtl0 as ProcAddtl on Processor.ResourceID = ProcAddtl.ResourceID
WHERE SYS.Netbios_Name0 LIKE @variable

.... where you would have a prompt for "variable" with this as the prompt sql:

begin
if (@__filterwildcard = '')
SELECT DISTINCT SYS.Netbios_Name0 from v_R_System SYS ORDER By SYS.Netbios_Name0
else
SELECT DISTINCT SYS.Netbios_Name0 from v_R_System SYS
WHERE SYS.Netbios_Name0 like @__filterwildcard
ORDER By SYS.Netbios_Name0
end

 

Any help would be great. Thanks!

Share this post


Link to post
Share on other sites

That's what I was trying to test by creating a report in sql for. I figured if I could at least see the new table (Processor_Addtl) in sql and it had zero data, that was a good start. Then I could at least initiate a hardware scan and the review the query to make sure something was being pulled. But when I build the query in Views, I don't see it listed under Tables or Views. Which is why I'm either blind as a bat searching for the table or I have clearly missed several steps I'm not aware of that I must do.

Share this post


Link to post
Share on other sites

Hi Garth,

 

That def. was the issue. I'm starting to get some data. This is the sql statement I'm using:

 

SELECT DISTINCT
TOP (100) PERCENT SYS.Netbios_Name0 AS 'Server', Processor.Name0, Processor.NormSpeed0 AS [CPU Speed], Processor.DeviceID0,
ProcAddtl.NumberOfCores0 AS [Number of Cores], ProcAddtl.NumberOfLogicalProcessors0 AS [Number of Logical Processors],
dbo.v_GS_OPERATING_SYSTEM.Caption0 AS 'OS', dbo.v_GS_COMPUTER_SYSTEM.Manufacturer0 AS 'Vendor'
FROM dbo.v_R_System AS SYS INNER JOIN
dbo.v_GS_PROCESSOR AS Processor ON SYS.ResourceID = Processor.ResourceID INNER JOIN
dbo.v_GS_X86_PC_MEMORY ON SYS.ResourceID = dbo.v_GS_X86_PC_MEMORY.ResourceID INNER JOIN
dbo.v_GS_OPERATING_SYSTEM ON SYS.ResourceID = dbo.v_GS_OPERATING_SYSTEM.ResourceID INNER JOIN
dbo.v_GS_COMPUTER_SYSTEM ON SYS.ResourceID = dbo.v_GS_COMPUTER_SYSTEM.ResourceID LEFT OUTER JOIN
dbo.v_GS_Processor_Addtl0 AS ProcAddtl ON Processor.ResourceID = ProcAddtl.ResourceID
WHERE (dbo.v_GS_OPERATING_SYSTEM.Caption0 LIKE '%Server%') AND (dbo.v_GS_COMPUTER_SYSTEM.Manufacturer0 = 'VMware, Inc.')
ORDER BY 'Server'

 

And the output (changed the server names):

 

SST018 Intel® Xeon® CPU X5660 @ 2.80GHz 2800 CPU1 NULL NULL Microsoft® Windows® Server 2003, Standard Edition VMware, Inc.

TTAD01 Intel® Xeon® CPU X5660 @ 2.80GHz 2800 CPU0 NULL NULL Microsoft® Windows® Server 2003, Standard Edition VMware, Inc.

TTAD01 Intel® Xeon® CPU X5660 @ 2.80GHz 2800 CPU1 NULL NULL Microsoft® Windows® Server 2003, Standard Edition VMware, Inc.

TTAD01 Intel® Xeon® CPU X5660 @ 2.80GHz 2800 CPU2 NULL NULL Microsoft® Windows® Server 2003, Standard Edition VMware, Inc.

TTAD01 Intel® Xeon® CPU X5660 @ 2.80GHz 2800 CPU3 NULL NULL Microsoft® Windows® Server 2003, Standard Edition VMware, Inc.

RSTAD01 Intel® Xeon® CPU E5-2665 0 @ 2.40GHz 2400 CPU0 NULL NULL Microsoft® Windows® Server 2003, Standard Edition VMware, Inc.

RSTAD01 Intel® Xeon® CPU E5-2665 0 @ 2.40GHz 2400 CPU1 NULL NULL Microsoft® Windows® Server 2003, Standard Edition VMware, Inc.

HRSMS021 Intel® Xeon® CPU E7420 @ 2.13GHz 2130 CPU0 1 1 Microsoft® Windows Server® 2008 Standard VMware, Inc.

HRSMS021 Intel® Xeon® CPU E7420 @ 2.13GHz 2130 CPU1 1 1 Microsoft® Windows Server® 2008 Standard VMware, Inc.

HRSMS112 Intel® Xeon® CPU X7560 @ 2.27GHz 2270 CPU0 1 1 Microsoft Windows Server 2008 R2 Standard VMware, Inc.

HRSMS112 Intel® Xeon® CPU X7560 @ 2.27GHz 2270 CPU1 1 1 Microsoft Windows Server 2008 R2 Standard VMware, Inc.

HRSMS112 Intel® Xeon® CPU X7560 @ 2.27GHz 2270 CPU2 1 1 Microsoft Windows Server 2008 R2 Standard VMware, Inc.

HRSMS112 Intel® Xeon® CPU X7560 @ 2.27GHz 2270 CPU3 1 1 Microsoft Windows Server 2008 R2 Standard VMware, Inc.

 

Is there a way to rewrite it so that it gives the totals for each server like Sherri created in report (the above link)? Her query is for one computer, I would like to show all computers, but with one entry per line.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...