MRTG 安装配置文档.docx_第1页
MRTG 安装配置文档.docx_第2页
MRTG 安装配置文档.docx_第3页
MRTG 安装配置文档.docx_第4页
MRTG 安装配置文档.docx_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

安装snmpyum install net-snmp net-snmp-utils -y配置snmpvim /etc/snmp/snmpd.conf替换com2sec notConfigUser default public为com2sec local localhost publiccom2sec mynetwork /24 public替换group notConfigGroup v1 notConfigUsergroup notConfigGroup v2c notConfigUser为group MyRWGroup v1 localgroup MyRWGroup v2c localgroup MyRWGroup usm localgroup MyROGroup v1 mynetworkgroup MyROGroup v2c mynetworkgroup MyROGroup usm mynetwork替换view systemview included system为view all included .1 80替换access notConfigGroup any noauth exact systemview none none为access MyROGroup any noauth exact all none noneaccess MyRWGroup any noauth exact all all none替换syslocation Unknown (edit /etc/snmp/snmpd.conf)syscontact Root (configure /etc/snmp/snmp.local.conf)为syslocation RHEL6, Home Linux Router.syscontact Vivek G Gite /etc/init.d/snmpd startchkconfig snmpd on snmpwalk -v 1 -c public localhost IP-MIB:ipAdEntIfIndex#IP-MIB:ipAdEntIfIndex. = INTEGER: 1#IP-MIB:ipAdEntIfIndex. = INTEGER: 2安装MRTGmkdir /opt/nginx/mrtg /ln -s /opt/nginx/mrtg /opt/nginx/static/mrtgyum -y install mrtgcp -a /var/www/mrtg/* /opt/nginx/mrtg/cfgmaker -global WorkDir: /opt/nginx/static/mrtg -output /etc/mrtg/mymrtg.cfg publiclocalhostindexmaker -output=/opt/nginx/static/mrtg/index.html /etc/mrtg/mymrtg.cfg执行三次env LANG=C /usr/bin/mrtg /etc/mrtg/mymrtg.cfg然后就可以通过web方式访问mrtg的界面了/mrtg/crontab -e*/5 * * * * /usr/bin/mrtg /etc/mrtg/mymrtg.cfg -logging /var/log/mrtg.log配置MRTG添加以下内容到/etc/mrtg/mymrtg.cfg#CPU# Targetcpu: /opt/mrtg/cpu.sh MaxBytescpu: 100 Titlecpu: CPU -hongpanOptionscpu: gauge,nopercent,growright YLegendcpu: CPU loading (%) ShortLegendcpu:% LegendOcpu: & CPU USER; LegendIcpu: & CPU SYSTEM; PageTopcpu: CPU负载 # MEM 8G # Targetmanagemem:/opt/mrtg/mem.sh Unscaledmanagemem: dwym MaxBytesmanagemem: 8192000 Titlemanagemem:Memory ShortLegendmanagemem: & kmgmanagemem:kB,MB kilomanagemem:1024 YLegendmanagemem: Memory Usage Legend1managemem: Total Memory Legend2managemem: Used Memory LegendImanagemem: Total Memory LegendOmanagemem: Used Memory Optionsmanagemem: growright,gauge,nopercent PageTopmanagemem:内存使用 # Disk I/O 100K/sec /DEV/SDA # # If you want monitor more disk, please copy below create # now monitor job, and copy & modify the diskperf.sh to setting disk. TargetdiskIO: /opt/mrtg/diskperf.sh TitlediskIO: Disk HDA I/O Utilization Report UnscaleddiskIO: dwym MaxBytesdiskIO: 10000 PageTopdiskIO: 磁盘I/O kmgdiskIO: KB,MB,GB LegendIdiskIO: Disk I/O KBread/sec LegendOdiskIO: Disk I/O KBwrite/sec Legend1diskIO: Disk I/O KBread/sec Legend2diskIO: Disk I/O KBwrite/sec YLegenddiskIO: Megabytes ShortLegenddiskIO: & OptionsdiskIO: growright,gauge,nopercent#虹盘在线人数#T_person: /opt/mrtg/person.sh MaxB_person: 5000 O_person: gauge, nopercent, growright YL_person: Online Users ShortL_person: % LegendI_person:   LegendO_person:   T_person: WWW 上線人數統計表 PageT_person: 虹盘在线人数 # # System: Aerosol Lab. in Redhat 6.1 Kernel 2.2.18 # Maintainer: VBird # # Swap 16G # Targetswap:/opt/mrtg/swap.sh Unscaledswap: dwym MaxBytesswap: 16384000 Titleswap:Memory State of Server ShortLegendswap: & kmgswap:kB,MB kiloswap:1024 YLegendswap: Swap Usage Legend1swap: Total Swap Legend2swap: Used Swap LegendIswap: Total Swap LegendOswap: Used Swap Optionsswap: growright,gauge,nopercent PageTopswap:交换分区脚本文件# cat /opt/mrtg/cpu.sh #!/bin/bash cpuusr=/usr/bin/sar -u 1 3 |grep Average |awk print $3 cpusys=/usr/bin/sar -u 1 3 |grep Average |awk print $5 UPtime=/usr/bin/uptime |awk print $3 $4 $5 echo $cpuusr echo $cpusys echo $Uptime# cat /opt/mrtg/diskperf.sh #!/bin/bash # This script will monitor the KBread/sec &KBwriten/sec of Disk, and sent out the Blk_read/s and Blk_wrtn/s to MRTG, to make the performance image. # Creater: CCC IT loren ext:2288 2005/8/3 # Set the who need monitor device. As sda ,sdb,sdc,sdd,hda. # disk=sda hd=hda disk=/dev/$hd #UPtime=/usr/bin/uptime |awk print KBread_sec=iostat -x $disk|grep $hd |awk print $6 KBwrite_sec=iostat -x $disk|grep $hd |awk print $7 echo $KBread_sec echo $KBwrite_sec# cat /opt/mrtg/mem.sh #!/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 echo $totalmem echo $usedmem# cat /opt/mrtg/person.sh #!/bin/bash # 1. 計算連線的數目 echo netstat -a | grep http|awk print $5|sort | wc -l|awk print$1 - 1 # 底下在說明整個咚咚的列出(檢查用) # netstat -a | grep www|awk print $5|sort| uniq # 2. 計算連線人數: echo netstat -a | grep http|awk print $5|cut -d: -f1|sort| uniq |wc -l | awk print $1 - 1 # netstat -a | grep www|awk print $5|cut -d: -f1|sort| uniq # 3. 輸出時間咚咚 UPtime=/usr/bin/uptime | awk print $3 $4 $5 # cat /opt/mrtg/swap.sh #!/bin/bash # run this script to check the swap usage. totalswap=/usr/bin/free |grep Swap |awk print usedswap=/usr/bin/free |grep Swap |awk print echo $totalswap echo $usedswap常见问题修改了配置文件/etc/mrtg/mymrtg.cfg 后,网页没有生效indexmaker -output=/opt/nginx/static/mrtg/index.html -title=ceshi.hongpan /etc/mrtg/mymrtg.cfgmrtg.cfg 里面几个参数的意思. Target:是要执行

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论