Closed exa-mk closed 2 years ago
I will take a look at this
I was able to reproduce this. Hopefully I can fix it as well^^
{
"agent": {
"last_updated": "2022-04-21 08:34:45.822389661 +0200 CEST m=+1591.430854078",
"last_updated_timestamp": 1650522885,
"system": "ubuntu",
"system_uptime": 1596,
"kernel_version": "5.4.0-100-generic",
"mac_version": "20.04",
"windows_release_id": "",
"windows_current_build": "",
"family": "debian",
"agent_version": "3.0.8",
"temperature_unit": "C",
"goos": "linux",
"goarch": "amd64"
},
"cpu": {
"cpu_total_percentage": 21.410579345085928,
"cpu_percentage": [
66.66666666668199,
49.00000000000091,
55.999999999988916,
49.504950495055574
],
"cpu_total_percentage_detailed": {
"User": 4.004988695024234,
"Nice": 0.27813078453693746,
"System": 2.259891459619005,
"Idle": 0,
"Iowait": 0.6525982523800364
},
"cpu_percentage_detailed": [
{
"User": 3.210962910667911,
"Nice": 0.37757494768160166,
"System": 1.8721161846650365,
"Idle": 93.96132220569326,
"Iowait": 0.17964751266987725
},
{
"User": 3.32591579305693,
"Nice": 0.27800016390032345,
"System": 1.9472619190206326,
"Idle": 94.01133433774814,
"Iowait": 0.15318376378181087
},
{
"User": 3.327618159125579,
"Nice": 0.1828015279686338,
"System": 1.943999697431954,
"Idle": 94.13144060211042,
"Iowait": 0.18910502893306944
},
{
"User": 6.158919062328262,
"Nice": 0.2735191747680141,
"System": 3.2778083091714203,
"Idle": 87.87987896934439,
"Iowait": 2.0908740611596457
}
]
},
}
This issue was resolved with version 3.0.9 of the agent.
The issue was caused by too many measurements, which were split across 2 seconds. The measurements itself where correct but two seconds are a lot of time for a computer, and if the kernel moves a process from one cpu core to another one, the results get quite confusing (and wrong).
We resolved this by doing only one measurement, and by calculating all the required numbers by our self instead of calling multiple functions from gopsutil.
The calculations are the same as htop uses. https://github.com/it-novum/openitcockpit-agent-go/blob/50ef9028675b8e70a989dc07771ed8048347e960/checks/cpu_posix.go#L29-L45
Feel free to comment/reopen if you are still experiencing the same issue with version 3.0.9
Agent Mode:
Versions
Operating system Please provide detailed operating system description (please do not just say "windows" or "linux"), installed antivirus, anything else that could be helpful information CentOS 7
Describe the bug We have a multicore vm (proxmox qemu) with CentOS running. In the vm a java process is running which occasionally uses a bit cpu, but just for moments on a higher scale. However, the openitcockpit-agent reports permantly high cpu usage percentage (not cpu load). When I look into the json data the agent provides to the server it get's confusing. The overall cpu percentage values per core are >90%, in the detailed data the core are mostly idling:
To Reproduce Steps to reproduce the behavior: not sure
Expected behavior Consistent cpu percentage usage data in the agent jsons.
Screenshots see snippet above
Additional context n/a