You have a Linux box. It has RAM. You'd like to log and monitor memory usage. You have many options -- here's one: use a check_mem plugin for Nagios, but use it stand-alone at first. You'll have detailed memory logging in just a minute, and will take your first step toward full system monitoring with Nagios (later when you can formally install the plugin).
Download: https://raw.github.com/justintime/nagios-plugins/master/check_mem/check_mem.pl
Read it and make sure you feel comfortable running it. Then chmod a+x check_mem.pl
and see help with ./check_mem.pl -h
. In one shell, run it in a 5s loop, logging to /tmp/mem.log (Control-C to stop):
while [ 1 ]; do date | tee -a /tmp/mem.log; ./check_mem.pl -u -w 60 -c 90 | tee -a /tmp/mem.log; sleep 5; done
If you'd like to see the memory log in more than one place (even as another user), you can watch the log:
tail -F /tmp/mem.log
Of course, this is a temporary solution. Next, unbox Nagios and work toward getting a graph like this: http://sysadminsjourney.com/content/2009/06/04/new-and-improved-checkmempl-nagios-plugin