Server Statistics dashlet not showing CPU Stats

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
J.A.K
Posts: 103
Joined: Wed Aug 05, 2020 11:39 am

Server Statistics dashlet not showing CPU Stats

Post by J.A.K »

For some reason my Server Statistics dashlet won't display CPU information on my XI server
Capture.PNG
Everything else displays fine and I can still pull CPU load with service checks without issue. Any idea what may be wrong?
You do not have the required permissions to view the files attached to this post.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Server Statistics dashlet not showing CPU Stats

Post by dchurch »

What distro are you running?

If you PM me a system profile I can diagnose further. Get one by going to Admin (top menu) => System Profile (in the left menu), then clicking the blue button.

Edit: Profile received. Not adding this to a reply below because it would bump it from the queue.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
J.A.K
Posts: 103
Joined: Wed Aug 05, 2020 11:39 am

Re: Server Statistics dashlet not showing CPU Stats

Post by J.A.K »

Ty. Sent that over your way.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Server Statistics dashlet not showing CPU Stats

Post by dchurch »

Profile received. Looks like the process that inserts system stat info into the database is coming up empty when it asks the system for it.

What output does the following command produce?

Code: Select all

/usr/bin/iostat -c 5 2
And this one?

Code: Select all

getenforce
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
J.A.K
Posts: 103
Joined: Wed Aug 05, 2020 11:39 am

Re: Server Statistics dashlet not showing CPU Stats

Post by J.A.K »

capture2.PNG
First one looks fine to me I also tried it as the Nagios account to make sure. Second one says disabled.
You do not have the required permissions to view the files attached to this post.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Server Statistics dashlet not showing CPU Stats

Post by dchurch »

It appears the piece of code that munges the output from the iostat program isn't compatible with both the new (Ubuntu 18+, RHEL 8+) and older (Cent7) versions.

I submitted a bug report to fix this. With any luck, it'll get included in the next release cycle of Nagios XI 5.7.6.

In the mean time, here are steps you can follow as a temporary workaround:
  1. Edit /usr/local/nagiosxi/cron/sysstat.php
  2. On line 268, where it says:

    Code: Select all

    $cmdline = sprintf("/usr/bin/iostat -c 5 2 | tail --lines=2 | head --lines=1 | awk '{ print $1,$2,$3,$4,$5,$6 }'");
    Replace this with:

    Code: Select all

    $cmdline = '/usr/bin/iostat -c 5 2 | grep -v \'^ *$\' | tail -1 | awk \'{ print $1,$2,$3,$4,$5,$6 }\'';
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
J.A.K
Posts: 103
Joined: Wed Aug 05, 2020 11:39 am

Re: Server Statistics dashlet not showing CPU Stats

Post by J.A.K »

Yep changed that and restarted the monitoring engine and they immediately appeared. Thank you!
Locked