Ubuntu下安装配置MRTG

FreeBsd下安装和配置MRTG:MRTG是什么?MRTG(Multi Router Traffi
首页 新闻资讯 行业资讯 Ubuntu下安装配置MRTG

  ubuntu安装配置mrtg - [Ubuntu]

  1.mrtg 安装

复制

  apt-get install mrtg snmpd
  • 1.

  • 2.

  编辑snmpd:

复制

  nano /etc/snmp/snmpd.conf
  • 1.

  • 2.

  查找到类似的行,修改为如下所示:(仅仅修改屏蔽或放开)

复制

  # sec.name source community     # com2sec paranoid default public # kommentieren     com2sec readonly default public # <- auskommentieren     #com2sec readwrite default private
  • 1.

  • 2.

  • 3.

  • 4.

  • 5.

  • 6.

  • 7.

  • 8.

  重启snmpd服务:

复制

  /etc/init.d/snmpd restart
  • 1.

  • 2.

  2.生成并修改配置文件

复制

  cfgmaker public@localhost > /etc/mrtg.cfg
  • 1.

  • 2.

  说明:将以下内容复制到/etc/mrtg.cfg文件***,将里面的IP修改为本机服务器IP,主机名www2修改为自己的

复制

  vi /etc/mrtg.cfg     LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt     Target[cpu]:ssCpuRawUser.0&ssCpuRawIdle.0:public@localhost     RouterUptime[cpu]: public@localhost     MaxBytes[cpu]: 100     Title[cpu]: CPU LOAD (localhost)     PageTop[cpu]:     Unscaled[cpu]: ymwd     ShortLegend[cpu]: %     YLegend[cpu]: CPU Utilization     Legend1[cpu]: User CPU in % (Load)     Legend2[cpu]: Idle CPU in % (Load)     LegendI[cpu]: User     LegendO[cpu]: Idle     Options[cpu]: growright,nopercent     Target[usrsys]:ssCpuRawUser.0&ssCpuRawSystem.0:public@localhost     RouterUptime[usrsys]: public@localhost     MaxBytes[usrsys]: 100     Title[usrsys]: CPU LOAD (localhost)     PageTop[usrsys]:     Unscaled[usrsys]: ymwd     ShortLegend[usrsys]: %     YLegend[usrsys]: CPU Utilization     Legend1[usrsys]: User CPU in % (Load)     Legend2[usrsys]: System CPU in % (Load)     LegendI[usrsys]: User     LegendO[usrsys]: System     Options[usrsys]: growright,nopercent     Target[cpusum]:ssCpuRawUser.0&ssCpuRawUser.0:public@localhost + ssCpuRawSystem.0&ssCpuRawSystem.0:public@localhost + ssCpuRawNice.0&ssCpuRawNice.0:public@localhost     RouterUptime[cpusum]: public@localhost     MaxBytes[cpusum]: 100     Title[cpusum]: CPU LOAD (localhost)     PageTop[cpusum]:     Unscaled[cpusum]: ymwd     ShortLegend[cpusum]: %     YLegend[cpusum]: CPU Utilization     Legend1[cpusum]: Active CPU in % (Load)     LegendI[cpusum]: Active     Options[cpusum]: growright,nopercent     Target[tcpopen]: .1.3.6.1.2.1.6.9.0&.1.3.6.1.2.1.6.9.0:public@localhost     Options[tcpopen]: nopercent,growright,gauge,noinfo     Title[tcpopen]: Open TCP connections     PageTop[tcpopen]:     MaxBytes[tcpopen]: 1000000     ShortLegend[tcpopen]: connections     LegendI[tcpopen]: Connections:     Legend1[tcpopen]: Open TCP connections     Target[packet]:ifInUcastPkts.2&ifOutUcastPkts.2:public@localhost     MaxBytes[packet]: 80000000     Options[packet]:growright,bits     Title[packet]: IP Packet Count     PageTop[packet]:     YLegend[packet]: IP Packet Count
  • 1.

  • 2.

  • 3.

  • 4.

  • 5.

  • 6.

  • 7.

  • 8.

  • 9.

  • 10.

  • 11.

  • 12.

  • 13.

  • 14.

  • 15.

  • 16.

  • 17.

  • 18.

  • 19.

  • 20.

  • 21.

  • 22.

  • 23.

  • 24.

  • 25.

  • 26.

  • 27.

  • 28.

  • 29.

  • 30.

  • 31.

  • 32.

  • 33.

  • 34.

  • 35.

  • 36.

  • 37.

  • 38.

  • 39.

  • 40.

  • 41.

  • 42.

  • 43.

  • 44.

  • 45.

  • 46.

  • 47.

  • 48.

  • 49.

  • 50.

  • 51.

  • 52.

  • 53.

  • 54.

  • 55.

  • 56.

  • 57.

  • 58.

  • 59.

  • 60.

  • 61.

  • 62.

  • 63.

  • 64.

  • 65.

  • 66.

  • 67.

  • 68.

  • 69.

  • 70.

  • 71.

  • 72.

  • 73.

  • 74.

  • 75.

  • 76.

  • 77.

  • 78.

  • 79.

  • 80.

  • 81.

  • 82.

  • 83.

  • 84.

  • 85.

  • 86.

  • 87.

  • 88.

  • 89.

  • 90.

  • 91.

  • 92.

  • 93.

  • 94.

  • 95.

  • 96.

  • 97.

  • 98.

  • 99.

  • 100.

  • 101.

  • 102.

  • 103.

  • 104.

  • 105.

  • 106.

  3.生成首页

复制

  indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html
  • 1.

  • 2.

  Ubuntu下安装配置MRTG完成!

【编辑推荐】

Mrtg流量监控

如何在FreeBSD下用MRTG监测网路流量

如何使用MRTG监控CPU温度

14    2011-03-31 10:31:18    Ubuntu 安装 MRTG