Go through http://kbase.redhat.com/faq/FAQ_40_11143.shtm this document which his written for Red Hat.
yum install sysstat
yum instal mrtg
edit /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html/mrtg/disk"
Start services
# service httpd start
# chkconfig httpd on
# mkdir -p /var/www/html/mrtg/disk/
edit vi /var/www/html/mrtg/disk/mrtg_disk.sh
#!/bin/bash
hd=hda
disk=/dev/$hd
UPtime=`/usr/bin/uptime |awk '{print $3""$4""$5}'`
KBread_sec=`iostat -x $disk|grep $hd |awk '{print $8}'`
KBwrite_sec=`iostat -x $disk|grep $hd |awk '{print $9}'`
echo $KBread_sec
echo $KBwrite_sec
echo $UPtime
hostname
# chmod u+x /var/www/html/mrtg/disk/mrtg_disk.sh
edit /var/www/html/mrtg/disk/mrtg_cfg_disk
WorkDir: /var/www/html/mrtg/disk
Target[disk]: `/var/www/html/mrtg/disk/mrtg_disk.sh`
Title[disk]: Disk HDA I/O Utilization Report
#Unscaled[disk]: dwym
MaxBytes[disk]: 10240000
PageTop[disk]:
Disk I/O Utilization Report
kmg[disk]: KB,MB,GB
LegendI[disk]: Disk I/O KBread/sec
LegendO[disk]: Disk I/O KBwrite/sec
Legend1[disk]: Disk I/O KBread/sec
Legend2[disk]: Disk I/O KBwrite/sec
YLegend[disk]: Megabytes
ShortLegend[disk]: &
Options[disk]: growright,gauge,nopercent
edit crontab
*/3 * * * * /usr/bin/mrtg /var/www/html/mrtg/disk/mrtg_cfg_disk
No comments:
Post a Comment