四安装内存使用监视[默认5分钟采集一次] 切换到超级用户: sudo -sH 建立RAM脚本: mkdir /opt/mrtg vim /opt/mrtg/mrtg.ram #!/bin/bash # run this script to check the mem usage. totalmem=`/usr/bin/free |grep Mem |awk '{print $2}'` usedmem=`/usr/bin/free |grep Mem |awk '{print $3}'` UPtime=`/usr/bin/uptime | awk '{print $3""$4""$5}'` echo $totalmem echo $usedmem echo $UPtime hostname 使脚本可以执行: chmod +755 /opt/mrtg/mrtg.ram 修改 /etc/mrtg.cfg 在文件最后加入ram项目 Target[ram]: `/opt/mrtg/mrtg.ram` #Unscaled[ram]: dwym MaxBytes[ram]: 2048000 Title[ram]:Memory ShortLegend[ram]: & kmg[ram]:kB,MB kilo[ram]:1024 YLegend[ram]: Memory Usage : Legend1[ram]: Total Memory : Legend2[ram]: Used Memory : LegendI[ram]: Total Memory : LegendO[ram]: Used Memory : Options[ram]: growright,gauge,nopercent PageTop[ram]:

Memory

**少掉步驟:env LANG=C mrtg /etc/mrtg.cfg 重新生成索引页面: indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html 访问: http://localhost/mrtg/ 五安装FTP连接数监视[默认5分钟采集一次] 切换到超级用户: sudo -sH 建立FTP脚本: mkdir /opt/mrtg vim /opt/mrtg/mrtg.ftp #!/bin/bash all=`netstat -a | grep ftp|awk '{print $5}'|sort | wc -l|awk '{print$1 - 1}'` user=`netstat -a | grep ftp|awk '{print $5}'|cut -d":" -f1|sort| uniq |wc -l | awk '{print $1 - 1}'` if [ "$all" = "-1" ]; then echo 0 else echo $all fi if [ "$user" = "-1" ]; then echo 0 else echo $user fi UPtime=`/usr/bin/uptime | awk '{print $3 " " $4 " " $5}'` echo $UPtime hostname 使脚本可以执行: chmod +755 /opt/mrtg/mrtg.ftp 修改 /etc/mrtg.cfg 在文件最后加入ftp项目 Target[ftp]: `/opt/mrtg/mrtg.ftp` MaxBytes[ftp]: 500 Options[ftp]: nopercent, growright YLegend[ftp]: Online Users ShortLegend[ftp]: % LegendI[ftp]: Connect : LegendO[ftp]: Online : Title[ftp]: FTP Connect PageTop[ftp]:

FTP Connect

**少掉步驟:env LANG=C mrtg /etc/mrtg.cfg 重新生成索引页面: indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html 访问: http://localhost/mrtg/ 六安装CPU温度监视[默认5分钟采集一次] 切换到超级用户: sudo -sH 安装软件: apt-get install mbmon 建立CPU温度脚本: mkdir /opt/mrtg vim /opt/mrtg/mrtg.temp #!/bin/bash /usr/bin/mbmon -c 1 -i -T 4 -u -n exit 0 使脚本可以执行: chmod +755 /opt/mrtg/mrtg.temp 修改 /etc/mrtg.cfg 在文件最后加入cpu项目 Target[temp]: `/opt/mrtg/mrtg.temp` MaxBytes[temp]: 100 Title[temp]: CPU Temperature PageTop[temp]:

CPU Temperature

Options[temp]: gauge,absolute,unknaszero,growright YLegend[temp]: Temperature(C) ShortLegend[temp]: (C) Legend1[temp]: CPU Temperature Legend2[temp]: M/B Temperature LegendI[temp]: CPU Temp. LegendO[temp]: M/B Temp. **少掉步驟:env LANG=C mrtg /etc/mrtg.cfg 重新生成索引页面: indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html 访问: http://localhost/mrtg/ 七硬盘读写监视[默认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/
創作者介紹
創作者 我的生活樂趣 的頭像
VieriKing

我的生活樂趣

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