Recent Changes - Search:

Softwares

.

GeneratingSystemStatsUsingLinuxCommandForLaterView

Main.GeneratingSystemStatsUsingLinuxCommandForLaterView History

Hide minor edits - Show changes to output

March 20, 2007, at 05:23 PM by 61.17.224.18 -
Changed lines 28-30 from:
*Add to cron cron
to:
*Add to cron.
March 20, 2007, at 05:22 PM by 61.17.224.18 -
Changed lines 28-30 from:
*Save that to a file called stats.sh and then excute it like this with a crontab
to:
*Add to cron cron
Changed lines 32-33 from:
*/5 * * * * /bin/sh /root/stats.sh >/dev/null 2>&1
to:
* * * * * /bin/sh /root/stats.sh >/dev/null 2>&1
March 20, 2007, at 05:21 PM by 61.17.224.18 -
Changed lines 3-5 from:
chmod +x /root/stats.sh
to:
Added lines 24-27:
*Change permission

chmod +x /root/stats.sh
March 20, 2007, at 04:30 PM by 61.17.224.18 -
Changed lines 26-28 from:
*Save that to a file called watch.sh and then excute it like this with a crontab
to:
*Save that to a file called stats.sh and then excute it like this with a crontab
March 20, 2007, at 04:30 PM by 61.17.224.18 -
Changed line 15 from:
/usr/bin/vmstat -S M >> $TEMPFILE
to:
/usr/bin/vmstat -m >> $TEMPFILE
Changed lines 25-26 from:
*%blue%Please use /usr/bin/vmstat -m is the above /usr/bin/vmstat don't works... out :)
to:
March 20, 2007, at 04:16 PM by 61.17.224.18 -
Changed lines 25-26 from:
*Please use /usr/bin/vmstat -m is the above /usr/bin/vmstat don't works... out :)
to:
*%blue%Please use /usr/bin/vmstat -m is the above /usr/bin/vmstat don't works... out :)
March 20, 2007, at 04:16 PM by 61.17.224.18 -
Changed lines 25-26 from:
to:
*Please use /usr/bin/vmstat -m is the above /usr/bin/vmstat don't works... out :)
Changed line 8 from:
TEMPFILE="/var/$(hostname)"
to:
TEMPFILE="/var/log/$(hostname)"
Added lines 1-30:
vi /root/stats.sh

chmod +x /root/stats.sh


#!/bin/sh
# Collect random system data
TEMPFILE="/var/$(hostname)"
echo "|----------System stat log file----------|" >> $TEMPFILE
echo "|--------------DATE----------------------|" >> $TEMPFILE
/bin/date >> $TEMPFILE
echo "" >> $TEMPFILE
echo "|--------------Memory Usage in MB--------|" >> $TEMPFILE
echo "" >> $TEMPFILE
/usr/bin/vmstat -S M >> $TEMPFILE
echo "" >> $TEMPFILE
echo "| Top 10 memory-consuming processes: |" >> $TEMPFILE
echo "" >> $TEMPFILE
ps aux --no-headers| sort -rn +3 | head >> $TEMPFILE
echo "" >> $TEMPFILE
echo " |++++++END OF SCAN ++++++|" >> $TEMPFILE
echo "" >> $TEMPFILE
## End


*Save that to a file called watch.sh and then excute it like this with a crontab


% crontab -e -u root
*/5 * * * * /bin/sh /root/stats.sh >/dev/null 2>&1
Edit - History - Print - Recent Changes - Search
Page last modified on March 20, 2007, at 05:23 PM