Guys, I have a question about memory, where I work we have been having heated debates about how to monitor memory in Linux. I am tasked to write a bash script that will alert me when our server are pegged using memory. I have been doing this to take a look at how much memory has been used. free -o -m total used free shared buffers cached Mem: 1134 1094 39 0 299 325 Swap: 2288 0 2288 I have been taking the total - cached = total memory used. I have also been looking at /proc/meminfo to make sure it matches, but from what I understand that's not the correct way to do it. I know that the three tools to use are free, top, vmstat. What is the best way to see what memory is being used. I found this script but every time it check it sends an alert that memory is over 90%, and that not good to get a lot of false alarms. !/bin/sh free -m | grep Mem | while read output; do mem=$(echo $output | awk '{print $2}' ) used=$(echo $output | awk '{ print $3 }' ) freed=$(echo $output | awk '{ print $4 }' ) echo "Swap : $mem" echo "Used : $used" echo "Free : $freed" usep=`expr $used \* 100 / $mem` echo $usep if [ $usep -ge 70 ]; then echo "Memory Usage Alert Total Memory: \"$mem\" Used: \"$used ($usep%)\" Free: \"$freed\" on $(hostname -f) as on $(date)" | mail -s "Alert: Memory Usage space $usep%" terrorpup@gmail.com fi done Does any one have a good script I can use, or can advise me on what is best practise for monitor memory. Thanks, Payne -- ---------------------------------------- When a place gets crowded enough to require ID's, social collapse is not far away. It is time to go elsewhere. The best thing about space travel is that it made it possible to go elsewhere. -- Robert Heinlein -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org