% Memory used calculation

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dsdonut
Posts: 32
Joined: Mon Mar 21, 2011 1:21 pm

% Memory used calculation

Post by dsdonut »

I'm in the process of a slow rollout of Nagios XI monitoring. As it stands right now, I am only monitoring 2 linux boxes. The memory check seems to be working correctly on one box, but not the other. As far as I can tell the check is configured the same way for each of them:

check_nrpe!check_mem!-a '-w 20 -c 10'!!!!!!

For one box, the % free memory is calculated correctly:

OK - 9431 / 12159 MB (77%) Free Memory, Used: 2728 MB, Shared: 0 MB, Buffers: 219 MB, Cached: 1044 MB

However, on the other box, it isn't even showing a value for free memory and because of that it is constantly in a warning state:

WARNING - 2315 / 4031 MB (%) Free Memory, Used: 1716 MB, Shared: 0 MB, Buffers: 136 MB, Cached: 461 MB

Anyone have any troubleshooting suggestions?
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: % Memory used calculation

Post by tonyyarusso »

The first step would be to establish exactly what command is being run on the target system, then log into that system and manually run the command yourself, as that will show more output than what is returned to Nagios.
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
dsdonut
Posts: 32
Joined: Mon Mar 21, 2011 1:21 pm

Re: % Memory used calculation

Post by dsdonut »

Thanks for the reply.

As far as I can tell, the command being run is check_nrpe!check_mem!-a '-w 20 -c 10'!!!!!!

but I don't believe I can just run that at the command line.

Where do I find the exact command being run?
dsdonut
Posts: 32
Joined: Mon Mar 21, 2011 1:21 pm

Re: % Memory used calculation

Post by dsdonut »

The check is exactly the same on each server, so I don't know why it is working on one but not the other.

On the server where it is not working, it is getting valid memory data - the correct amounts for used/total/cached, etc. It's just not calculating the percentage.
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: % Memory used calculation

Post by tonyyarusso »

Just a stab in the dark: This plugin might require an external tool for calculations that is not installed on your servers. It is quite common to use the 'bc' utility, and some distros do not install that by default.
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
dsdonut
Posts: 32
Joined: Mon Mar 21, 2011 1:21 pm

Re: % Memory used calculation

Post by dsdonut »

But both servers are the same distro, same build. They are even running the same internally developed application (just different components of it)

I just can't figure out why it is getting calculated on one server but not the other. At this point I haven't done any customizations of NRPE or xinetd, so even those are the same across the 2 monitored servers.
dsdonut
Posts: 32
Joined: Mon Mar 21, 2011 1:21 pm

Re: % Memory used calculation

Post by dsdonut »

Thanks for your help (not sure where my last post went - probably user error on my part)

The server was missing bc. Not sure how that happened, since both servers were built in the same manner. But anyways, the check is working now.

Thanks!
rdedon
Posts: 578
Joined: Sat Nov 20, 2010 4:51 pm

Re: % Memory used calculation

Post by rdedon »

Glad to see that this is resolved and feel free to post if you have any further issues. :-)
Rene deDon
Technical Team
___
Nagios Enterprises, LLC
Web: http://www.nagios.com
Locked