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
Answer
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
No comments:
Post a Comment