LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   AIX (https://www.linuxquestions.org/questions/aix-43/)
-   -   script to monitor memory - RAM (https://www.linuxquestions.org/questions/aix-43/script-to-monitor-memory-ram-4175452825/)

shravee 03-05-2013 01:24 PM

script to monitor memory - RAM
 
hi team,

I am interested to monitor the ram free space by monitoring it frequently. this should ensure to alert me if I run out of memory.

i am aware that both topas and nmon with m as an option can give me the memory details but I do not know to get them in some file so that i can read from them periodically.

can someone advise me the best possible solution to monitor memory.


regards
Shravee.

netnix99 03-05-2013 01:38 PM

There is a couple of different ways, but if you just want something cheap and dirty, you can create a cron job as root to run the following:

cat /proc/meminfo | grep MemFree >> /root/memfree.txt

Set it to run as often as you like.

Code:

*/5 * * * *  cat /proc/meminfo | grep MemFree >> memfree.txt
would run it every 5 minutes and write it to the file memfree.txt.

TB0ne 03-05-2013 01:43 PM

Quote:

Originally Posted by shravee (Post 4905312)
hi team,
I am interested to monitor the ram free space by monitoring it frequently. this should ensure to alert me if I run out of memory.

i am aware that both topas and nmon with m as an option can give me the memory details but I do not know to get them in some file so that i can read from them periodically.

can someone advise me the best possible solution to monitor memory.

You want to be 'advised' AGAIN on how to do this, and how to write shell scripts???
http://www.linuxquestions.org/questi...nd-4175439283/
http://www.linuxquestions.org/questi...t-file-802402/

Again, you need to read one of the MANY bash scripting tutorials, and look at the advice you've been given in other threads, then apply that to what you want to do.


All times are GMT -5. The time now is 12:21 AM.