Softwares |
Main /
Monitoring-linux-memory-usageMain.Monitoring-linux-memory-usage HistoryShow minor edits - Show changes to output Changed line 7 from:
(:table border=1 width= to:
(:table border=1 width=80% bgcolor=#cccc99 cellspacing=0 :) Added line 9:
[@ Added line 37:
@] Added lines 1-40:
(:Google1:) ---- '''Monitoring Linux Memory Usage Linux Script''' ---- (:Googlemm:) (:table border=1 width=0% bgcolor=#cccc99 cellspacing=0 :) (:cellnr:) ubuntu@server3:~$ cat memoryusage.sh #!/bin/bash # # Author:ITM # Script that tracks the current date, memory usage and running processes # echo '#!/bin/bash' > /root/memmon.sh echo " date; uptime free -m vmstat 1 5 ps auxf --width=200 " >> /root/memoryusage.sh chmod +x /root/memoryusage.sh # create a cronjob that runs every few minutes to log the memory usage echo '0-59/10 * * * * root /root/memoryusage.sh >> /root/memoryusage.txt' > /etc/cron.d/memoryusage # restart crond /etc/init.d/cron* restart # create a logrotate entry so the log file does not get too large echo '/root/memoryusage.txt {}' > /etc/logrotate.d/memoryusage (:tableend:) (:Google1:) ---- (:Googlemm:) |