seemingly incorrect memory and swapsapce

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: seemingly incorrect memory and swapsapce

Post by jbrunkow »

There are some differences between how top and Nagios check memory and swap usage. I probably won't be able to explain how they work in great detail, but I may be able to illuminate some differences.

I assume that you are using the plugin from NCPA to check memory?

Code: Select all

/usr/local/nagios/libexec/custom_check_mem
It looks like that plugin is just a bash script using the Linux utility free to check memory usage.

Code: Select all

memoutput=`free -m | head -2 | tail -1`
The other difference is that Nagios will do a series of checks before determining a state, and top is measuring those values in real time. This means that those reports could both be correct, but from slightly different time frames.
HARD AND SOFT STATES

You could try running a top and a free check simultaneously to view the differences.

Another option would be to find or script a plugin that uses top to check memory if you find that it is more accurate.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
UoGLibrary
Posts: 9
Joined: Mon Jan 26, 2015 12:24 pm

Re: seemingly incorrect memory and swapsapce

Post by UoGLibrary »

thank you very much, i'll check those out
Locked