Page 1 of 1

Re: seemingly incorrect memory and swapsapce

Posted: Thu Jun 18, 2020 3:17 pm
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.

Re: seemingly incorrect memory and swapsapce

Posted: Fri Jun 19, 2020 8:04 am
by UoGLibrary
thank you very much, i'll check those out