localhost Current Load with multiple CPUs

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

localhost Current Load with multiple CPUs

Post by Box293 »

I was looking at our Nagios XI server and noticed that it has a load of about 7 - 14 on average. This is a three CPU VM.

I was playing with the check_load command and noticed that there was the -r option that Divide the load averages by the number of CPUs.

without -r

Code: Select all

./check_load -w 5.0,4.0,3.0 -c 10.0,6.0,4.0
CRITICAL - load average: 14.27, 8.65, 8.25|load1=14.270;5.000;10.000;0; load5=8.650;4.000;6.000;0; load15=8.250;3.000;4.000;0;
with -r

Code: Select all

./check_load -w 5.0,4.0,3.0 -c 10.0,6.0,4.0 -r
OK - load average: 4.76, 2.88, 2.75|load1=4.757;5.000;10.000;0; load5=2.883;4.000;6.000;0; load15=2.750;3.000;4.000;0;
I then modified the Currnet Load service to use the -r. This is great, the localhost is no longer going into warning and critical states. I can also see the before and after affects when looking at the performance graphs for Current Load.
current load graphs - 4 hour.png
current load graphs - 1 week.png
However I've noticed that in the dashlet Server Statistics the load is still very high, it does not reflect the data for the Current Load service.

Question: Is there a way to make the dashlet Server Statistics match the service (use the -r option)
Suggestion: Change the Current Load service to use the -r option as the default setting. I know that the VM is distributed as a single CPU VM but it's less hassle to change it later on, also physical boxes are usually going to have > 1 CPU.
server statistics.png
Nagios XI 2009R1.4B running on a VMware VM on an ESXi 4.1 host.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: localhost Current Load with multiple CPUs

Post by mguthrie »

I see what you mean, and this is a decent idea, although the code for this change is buried somewhere that I was unable to find at the moment. I would suggest filing it as a feature request on our tracker. tracker.nagios.com.
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: localhost Current Load with multiple CPUs

Post by tonyyarusso »

Suggestion: Change the Current Load service to use the -r option as the default setting.
Makes sense to me. I filed it at http://tracker.nagios.com/view.php?id=126.
Question: Is there a way to make the dashlet Server Statistics match the service (use the -r option)
"Yes". I found the line of code that does this, and in the current SVN copy it's #185 in nagiosxi/basedir/cron/sysstat.php, which looks like this:

Code: Select all

	// GET LOAD INFO
	$cmdline=sprintf("/usr/bin/uptime | sed s/,//g | awk -F'average: ' '{  print $2 }'");
As you can see, this particular piece isn't even using the Nagios plugin, but just the uptime command directly. I would imagine though that you could change it to do so, with something like this:

Code: Select all

	// GET LOAD INFO
	$cmdline=sprintf("/usr/local/nagios/libexec/check_load -r -w 100,100,100 -c 200,200,200 | sed s/,//g | awk -F'average: ' '{  print $2 }' | sed 's/|.*//'");
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: localhost Current Load with multiple CPUs

Post by Box293 »

Cheers,
I'll have a play and see how it goes.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rdedon
Posts: 578
Joined: Sat Nov 20, 2010 4:51 pm

Re: localhost Current Load with multiple CPUs

Post by rdedon »

Very nice, thank you :-)
Rene deDon
Technical Team
___
Nagios Enterprises, LLC
Web: http://www.nagios.com
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: localhost Current Load with multiple CPUs

Post by Box293 »

Since I made the change that Tony suggested the Server Statistics dashlet has worked fine and is accurately reporting the data.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: localhost Current Load with multiple CPUs

Post by mguthrie »

Nice!! Glad it's working for you!
Locked