Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Once can have monit monitor memory usage…

check system foo
  if memory usage > 95% then alert

Does it use free RAM, or free -/+ buffers/cache? (or something else?)

# free -m
             total       used       free     shared    buffers     cached
Mem:           998        851        146          0        114         70
-/+ buffers/cache:        666        332
Swap:         2047         54       1993
share|improve this question

2 Answers 2

up vote 1 down vote accepted

This could be get from the source of monit https://github.com/arnaudsj/monit/tree/master/process.

For linux the value is computed in sysdep_LINUX.c and comes from /proc/meminfo :

si->total_mem_kbyte = systeminfo.mem_kbyte_max - mem_free - buffers - cached;

In other words monit use as memory usage MemTotal - MemFree - Buffers - Cached.

In your case 998 - 146 - 114 - 70 = 668

share|improve this answer

AFAIK, it based on:

used memory - cached = 851 - 70 = 781
share|improve this answer
3  
any documentation for that? –  John Bachir Nov 8 '11 at 3:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.