




已阅读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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 体育行业项目方案解读
- 安徽省合肥市庐江县柯坦中学2024-2025学年七年级下学期期末考试英语试题
- 国际教育交流项目2025年学生跨文化适应与教育国际化改革实践报告
- 新能源广告合规性2025年研究报告:技术创新与风险预警措施
- 2025年招标师职业资格考试招标采购管理与实务试卷及答案
- 采购申请与审批流程标准化作业表
- 2025版全新供用电合同发布
- 2025年企业车辆挂靠合同
- 2025年河南省三门峡市辅警考试题库(附答案)
- 2025年河南省公职人员时事政治考试试题(附含答案)
- 《三角函数的诱导公式(第1课时)》导学案2
- 全国赛课一等奖2024版新教材统编版七年级历史上册《中华文明的起源》课件
- GB/T 22838.5-2024卷烟和滤棒物理性能的测定第5部分:卷烟吸阻和滤棒压降
- 江苏省镇江市2024-2025学年高三上学期期初考试数学试卷(解析版)
- 全国职业院校技能大赛高职组(供应链管理赛项)备赛试题库(含答案)
- JT叔叔医道课1-50集完整稿
- 部编版五年级道德与法治上册第3课《主动拒绝烟酒与毒品》精美课件(第3课时)
- JB-T 8881-2020 滚动轴承 渗碳轴承钢零件 热处理技术条件
- 2024年四川省水电投资经营集团普格电力有限公司招聘笔试参考题库含答案解析
- G-T 20986-2023 信息安全技术 网络安全事件分类分级指南
- 建筑工程技术专业《建筑力学》课程标准
评论
0/150
提交评论