Missing number of CPU socket

Bug #1117110 reported by Marcus Asshauer
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OCS Inventory: Unified Unix Agent
Fix Released
Low
Frank

Bug Description

We cannot see how many CPU sockets are used on our servers. We only see the number of cpu cores. Is there a way to include the information about used cpu sockets?

Frank (frank-bourdeau)
Changed in ocsinventory-unix-agent:
assignee: nobody → Frank (frank-bourdeau)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Frank (frank-bourdeau) wrote :

Hi, can you test the script attached on a multi-sockets host and report here the result, please?

Thanks in advance

Kind regards

Frank (frank-bourdeau)
Changed in ocsinventory-unix-agent:
status: Confirmed → In Progress
Revision history for this message
Marcus Asshauer (mcas) wrote :

I tried your script on a 2 socket host and 2 cpus with 4 cores.

Result:
Number of CPU sockets used:1

I tried 2 simple debug outputs, perhaps it could help you:

"print $1" before you call "uniq":
0
1
0
1
0
1
0
1

"print $cpusocket" after you call "uniq":
1
1
1
1
1
1
1
1

Kind regars

Revision history for this message
Frank (frank-bourdeau) wrote :

Hi,

Thanks for your feedback. Can you test the following command and give me the result, please?
cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l

Thanks

Revision history for this message
Marcus Asshauer (mcas) wrote :

Hi,

the result is "2".

Revision history for this message
Frank (frank-bourdeau) wrote :

Hi,

Thanks for your feedback. Try this script and give me the result.
Normally you should have 2 as result.

Revision history for this message
Marcus Asshauer (mcas) wrote :

Hi,

I tested your script. If I try your script as it is, I got the following error message:

Type of arg 1 to keys must be hash (not concatenation (.) or string) at script.pl line 12, near ""\n";"
Execution of script.pl aborted due to compilation errors.

If I remove the "\n" in line 12 I got the correct output:

Number of CPU sockets used: 2

Revision history for this message
Frank (frank-bourdeau) wrote :

Thanks for your feedback.

Frank (frank-bourdeau)
Changed in ocsinventory-unix-agent:
status: In Progress → Fix Committed
mortheres (mortheres)
Changed in ocsinventory-unix-agent:
milestone: none → 2.1rc1
Revision history for this message
Marcus Asshauer (mcas) wrote :

We installed 2.1rc1 and found a problem with this feature. On a machine with 2 cpu sockets a 4 cores the website shows us 8 lines with cpu informations. This means line 1 has socket type 1 and all other lines have socket type 2.
Could you please try to fix this?
Thank you.

Revision history for this message
Eric Germán Burgueño (nevermind85) wrote :

I have the following missing fields on my VMware guests running RedHat or CentOS 6:
Serial Number
Core Count
Frequency
Current Address Width
Logical CPUs

For physical hosts, the output of `dmidecode -t processor` differs quite a bit, so I wouldn't rely solely on it.

Attached are the outputs of /proc/cpuinfo and dmidecode -t processor from one of my VM guests, and from one of my physical hosts.

Also, the following line should be commented out or removed from Ocsinventory/Agent/Backend/OS/Linux/Archs/i386/CPU.pm:

-print Dumper($current);
+#print Dumper($current);

otherwise the debug file complains:
[Thu Mar 6 15:26:27 2014][debug] runWithTimeout(): unexpected error: Undefined subroutine &Ocsinventory::Agent::Backend::OS::Linux::Archs::i386::CPU::Dumper called at /usr/local/share/perl5/Ocsinventory/Agent/Backend/OS/Linux/Archs/i386/CPU.pm line 88, <CPUINFO> line 38.

and no CPU info is parsed.

Revision history for this message
Eric Germán Burgueño (nevermind85) wrote :

I should also mention, on VMs, /proc/cpuinfo returns the Guest's CPU config as seen by the OS and configured on the VM host; but dmidecode bypasses this and reports the Physical host's info where the VM happens to be running on.

Revision history for this message
Eric Germán Burgueño (nevermind85) wrote :

I have just downloaded version 2.1.1 from trunk (revision 1189) and CPU information is still wrong. Now it reports three CPUs when my host has only two, and the first one of them has empty information. Additionally, core numbers is empty.

Please see attached cpuinfo.txt and CPU info.png.

Revision history for this message
Eric Germán Burgueño (nevermind85) wrote :

Difference between cat /proc/cpuinfo and dmidecode -t processor when host is a VM guest.

Frank (frank-bourdeau)
Changed in ocsinventory-unix-agent:
status: Fix Committed → Fix Released
Revision history for this message
Eric Germán Burgueño (nevermind85) wrote :

This bug continues to occur with the fix you just released.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.