七硬盘读写监视[默认5分钟采集一次] 切换到超级用户: sudo -sH 建立硬盘读写脚本: mkdir /opt/mrtg vim /opt/mrtg/mrtg.disk #!/bin/bash hd=sda 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 +755 /opt/mrtg/mrtg.disk 修改 /etc/mrtg.cfg 在文件最后加入硬盘读写 Target[disk]: `/opt/mrtg/mrtg.disk` 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 **少掉步驟:env LANG=C mrtg /etc/mrtg.cfg 重新生成索引页面: indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html 访问: http://localhost/mrtg/ 九:交换分区 切换到超级用户: sudo -sH 建立交换分区脚本: mkdir /opt/mrtg vim /opt/mrtg/mrtg.swap #!/bin/bash # This script to monitor the swap usage. totalswap=`/usr/bin/free |grep Swap |awk '{print $2}'` usedswap=`/usr/bin/free |grep Swap |awk '{print $3}'` echo "$totalswap" echo "$usedswap" 使脚本可以执行: chmod +755 /opt/mrtg/mrtg.swap 修改 /etc/mrtg.cfg 在文件最后加入 Target[swap]: `/opt/mrtg/mrtg.swap` MaxBytes[swap]: 2048000 Title[swap]:Memory State of Server ShortLegend[swap]: & kmg[swap]:kB,MB kilo[swap]:1024 YLegend[swap]: Swap Usage Legend1[swap]: Total Swap Legend2[swap]: Used Swap LegendI[swap]: Total Swap LegendO[swap]: Used Swap Options[swap]: growright,gauge,nopercent PageTop[swap]:

Swap

**少掉步驟:env LANG=C mrtg /etc/mrtg.cfg 重新生成索引页面: indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html 访问: http://localhost/mrtg/
創作者介紹
創作者 我的生活樂趣 的頭像
VieriKing

我的生活樂趣

VieriKing 發表在 痞客邦 留言(0) 人氣( 227 )