Recent Changes - Search:

Softwares

.

Monitoring-linux-memory-usage

Main.Monitoring-linux-memory-usage History

Hide minor edits - Show changes to output

August 15, 2012, at 01:41 PM by 115.242.228.192 -
Added line 2:
(:Googletxt:)
Deleted lines 37-38:

(:Google1:)
August 15, 2012, at 01:28 PM by 115.242.228.192 -
Deleted lines 4-5:
(:Googlemm:)
October 31, 2011, at 01:44 AM by 117.99.109.84 -
Changed line 7 from:
(:table border=1 width=0% bgcolor=#cccc99 cellspacing=0 :)
to:
(:table border=1 width=80% bgcolor=#cccc99 cellspacing=0 :)
Added line 9:
[@
Added line 37:
@]
October 31, 2011, at 01:43 AM by 117.99.109.84 -
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:)
Edit - History - Print - Recent Changes - Search
Page last modified on August 15, 2012, at 01:41 PM