[Nagiosplug-help] Nagios - check_mem

Andreas Ericsson ae at op5.se
Tue Sep 4 11:48:03 CEST 2007


Olivier 'Babar' Raginel wrote:
> Hello Andreas,
> 
> I e-mail you because I was just reviewing one of your old posts, and had 
> questions which Googling couldn't answer, when your name just popped up 
> in nagios-help.
> 
> So here it is:
> You wrote some time ago some check_mem.sh script. I'm confronted to the 
> same problem on Linux, and I've found many many ways to figure out the 
> free memory. Last one used by the plugin in contrib/ is to use the 
> buffers/cache line, which is supposed to be the number of free/used 
> memory as viewed from the application side, from what I could find.
> 
> Did you have a look at this script ? Is your version of the 
> check_mem.sh dead? (couldn't find it anywhere but on some german forum: 
> http://www.nagios-portal.de/forum/print.php?page=1&threadid=1902 )
> 
> Thanks a lot,
> 

If it's only for linux and you're half-fluent in C, you could use the
sysinfo(2) call to get all the raw figures from the kernel directly.

Other solutions are always a bit erratic, since no two unices have
the same memory management system and thus report free/used memory
a bit differently.

Perhaps the best way would be to have a C-program loaded with
#ifdef's (although I really hate that way of making things
portable).

Attached is the script, but I'm not sure if it works any longer.
I'm also Cc'ing the nagiosplug-help list, so others can find
at least the reference text should they look for it.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_mem.sh
Type: application/x-shellscript
Size: 5803 bytes
Desc: not available
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20070904/11f598ff/attachment.bin>


More information about the Help mailing list