Wrong number of CPU cores on Raspberry Pi 4 Model B / 8GB

CMK version:
check-mk-free-docker-2.0.0p20 - CMK site
check-mk-agent_2.0.0p20-dc8faf6d382df89e_all.deb - Agent on Raspberry Pi

OS version:
Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0-1052-raspi aarch64) - Raspberry Pi
Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0-100-generic x86_64) - CMK site

Error message:
Agent return number of CPU cores is 24 instead of 4

Output of “cmk --debug -vvn hostname”: (If it is a problem with checks or plugins)
Check no problem

Hi @vuanhson and welcome to the checkmk community.

Can you please provide the output of cat /proc/cpuinfo and the relevant agent section (<<<cpu>>>) to this check?

Hi
This is /proc/cpuinfo

processor	: 0
BogoMIPS	: 108.00
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

processor	: 1
BogoMIPS	: 108.00
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

processor	: 2
BogoMIPS	: 108.00
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

processor	: 3
BogoMIPS	: 108.00
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

Hardware	: BCM2835
Revision	: d03114
Serial		: 10000000530e269b
Model		: Raspberry Pi 4 Model B Rev 1.4

Is the agent section you said can collect by cmk -d myserver123 ?

You can either use cmk -d <hostname> or telnet <hostname> 6556 or run the agent at the host via /usr/bin/check_mk_agent.

This is the <<cpu>> part

<<<cpu>>>
0.33 0.17 0.11 2/279 102670 24
61714

What is the output of “uname -m”?

The number of CPUs is calculated as follows by the Checkmk agent:

if [ "$(uname -m)" = "armv7l" ] || [ "$(uname -m)" = "armv6l" ]; then
    CPU_REGEX='^processor'
else
    CPU_REGEX='^CPU|^processor'
fi
NUM_CPUS=$(grep -c -E $CPU_REGEX </proc/cpuinfo)

It looks like the “if” statement might need to be extended to another machine type. It might be more precise to count the number of empty line, though.

uname -m returned aarch64

So this is truly a bug in the Checkmk agent. I filed an issue to the feedback email address.

There was already a pull request and this one was merged today.

Can someone verify that this works and mark the right solution? Thanks!

nope, it still bug in 2.0.0p21 (agent + server)
Screen Shot 2022-03-15 at 14.05.42

Edit: it seem the fix commit was pushed 7 days ago but the newest tag is 12 days ago so I’ll wait for next version

Yes, the fix probably did not make it into the release. Please test again with p22, once it out. Thank you!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.