Page 1 of 1
CPU Usage - No matching data to display
Posted: Mon Nov 08, 2021 5:32 am
by jakai
Hello,
After updating Nagios XI to version 5.8.7, we have a problem with displaying CPU Usage values in metrics. Can you please help how to fix this error? Are the other data displayed correctly (RAM, Disk, etc.)?
Thank you for help.
Best Regards,
Josef Akai
IT Administrator
Re: CPU Usage - No matching data to display
Posted: Mon Nov 08, 2021 2:56 pm
by benjaminsmith
Hi Josef,
Thanks for getting in touch and welcome to the Customer Support Forum.
Do you recall what plugin or wizard you used to set up the CPU checks? I'd like to gather some data, can you run the tail command below, load this page and post the output.
Lastly, please send over a system profile and we'll check the other logs as well.
To send us your system profile.
Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Regards,
Benjamin
Re: CPU Usage - No matching data to display
Posted: Tue Nov 09, 2021 5:37 am
by jakai
Hello,
command "tail -f /var/log/httpd/*error_log" not funkcion, see Annex.
I am sending the profile in an attachment.
Moderator's Note: The profile has been shared with the support team but has been removed from the public forum.
Re: CPU Usage - No matching data to display
Posted: Tue Nov 09, 2021 3:33 pm
by benjaminsmith
Hi,
I was able to replicate this on my test system and it's a bug. I should be able to get you a patch soon if you would like to correct this before the next release. Let me know.
--Benjamin
Re: CPU Usage - No matching data to display
Posted: Tue Nov 09, 2021 4:39 pm
by benjaminsmith
Hi,
Update. To correct this, open the following file ( a good idea to save a backup to /tmp first):
Code: Select all
/usr/local/nagiosxi/html/includes/utils-metrics.inc.php
Change this line, around 708:
Code: Select all
if(!empty($perfpartsb[3])) {
$warn = $perfpartsb[3];
} else {
$display = 0;
}
if(!empty($perfpartsb[4])) {
$crit = $perfpartsb[4];
} else {
$display = 0;
}
$use = floatval(str_replace(str_split('=%'), '', $perfpartsb[2]));
To:
Code: Select all
if(!empty($perfpartsb[1])) {
$warn = $perfpartsb[1];
} else {
$display = 0;
}
if(!empty($perfpartsb[2])) {
$crit = $perfpartsb[2];
} else {
$display = 0;
}
$use = floatval(str_replace(str_split("'percent'=%"), '', $perfpartsb[0]));
Let me know if that resolves the issue.
--Benjamin
Re: CPU Usage - No matching data to display
Posted: Wed Nov 10, 2021 4:35 am
by jakai
Hello,
I fixed the error according to your instructions and it works! Thank you very much.
Re: CPU Usage - No matching data to display
Posted: Wed Nov 10, 2021 10:16 am
by benjaminsmith
Hi,
You're welcome. We'll have an official patch included in the next release.
Thanks for bringing this to our attention. We'll close this out for now, but feel free to open a new post if you need anything.
--Benjamin