Ubuntu下安装配置MRTG

运维 系统运维
FreeBsd下安装和配置MRTG:MRTG是什么?MRTG(Multi Router Traffic Grapher)是一个监控网络链路流量负载的工具软件,通过snmp协议得到设备的流量信息。本文讲述的是:如何在FreeBsd下安装和配置MRTG

  ubuntu安装配置mrtg - [Ubuntu]

  1.mrtg 安装

  1.   apt-get install mrtg snmpd  
  2.  

  编辑snmpd:

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

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

  1.   # sec.name source community  
  2.  
  3.   # com2sec paranoid default public # kommentieren  
  4.  
  5.   com2sec readonly default public # <- auskommentieren  
  6.  
  7.   #com2sec readwrite default private  
  8.  

  重启snmpd服务:

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

  2.生成并修改配置文件

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

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

  1.   vi /etc/mrtg.cfg  
  2.  
  3.   LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt  
  4.  
  5.   Target[cpu]:ssCpuRawUser.0&ssCpuRawIdle.0:public@localhost  
  6.  
  7.   RouterUptime[cpu]: public@localhost  
  8.  
  9.   MaxBytes[cpu]: 100  
  10.  
  11.   Title[cpu]: CPU LOAD (localhost)  
  12.  
  13.   PageTop[cpu]:  
  14.  
  15.   Unscaled[cpu]: ymwd  
  16.  
  17.   ShortLegend[cpu]: %  
  18.  
  19.   YLegend[cpu]: CPU Utilization  
  20.  
  21.   Legend1[cpu]: User CPU in % (Load)  
  22.  
  23.   Legend2[cpu]: Idle CPU in % (Load)  
  24.  
  25.   LegendI[cpu]: User  
  26.  
  27.   LegendO[cpu]: Idle  
  28.  
  29.   Options[cpu]: growright,nopercent  
  30.  
  31.   Target[usrsys]:ssCpuRawUser.0&ssCpuRawSystem.0:public@localhost  
  32.  
  33.   RouterUptime[usrsys]: public@localhost  
  34.  
  35.   MaxBytes[usrsys]: 100  
  36.  
  37.   Title[usrsys]: CPU LOAD (localhost)  
  38.  
  39.   PageTop[usrsys]:  
  40.  
  41.   Unscaled[usrsys]: ymwd  
  42.  
  43.   ShortLegend[usrsys]: %  
  44.  
  45.   YLegend[usrsys]: CPU Utilization  
  46.  
  47.   Legend1[usrsys]: User CPU in % (Load)  
  48.  
  49.   Legend2[usrsys]: System CPU in % (Load)  
  50.  
  51.   LegendI[usrsys]: User  
  52.  
  53.   LegendO[usrsys]: System  
  54.  
  55.   Options[usrsys]: growright,nopercent  
  56.  
  57.   Target[cpusum]:ssCpuRawUser.0&ssCpuRawUser.0:public@localhost + ssCpuRawSystem.0&ssCpuRawSystem.0:public@localhost + ssCpuRawNice.0&ssCpuRawNice.0:public@localhost  
  58.  
  59.   RouterUptime[cpusum]: public@localhost  
  60.  
  61.   MaxBytes[cpusum]: 100  
  62.  
  63.   Title[cpusum]: CPU LOAD (localhost)  
  64.  
  65.   PageTop[cpusum]:  
  66.  
  67.   Unscaled[cpusum]: ymwd  
  68.  
  69.   ShortLegend[cpusum]: %  
  70.  
  71.   YLegend[cpusum]: CPU Utilization  
  72.  
  73.   Legend1[cpusum]: Active CPU in % (Load)  
  74.  
  75.   LegendI[cpusum]: Active  
  76.  
  77.   Options[cpusum]: growright,nopercent  
  78.  
  79.   Target[tcpopen]: .1.3.6.1.2.1.6.9.0&.1.3.6.1.2.1.6.9.0:public@localhost  
  80.  
  81.   Options[tcpopen]: nopercent,growright,gauge,noinfo  
  82.  
  83.   Title[tcpopen]: Open TCP connections  
  84.  
  85.   PageTop[tcpopen]:  
  86.  
  87.   MaxBytes[tcpopen]: 1000000  
  88.  
  89.   ShortLegend[tcpopen]: connections  
  90.  
  91.   LegendI[tcpopen]: Connections:  
  92.  
  93.   Legend1[tcpopen]: Open TCP connections  
  94.  
  95.   Target[packet]:ifInUcastPkts.2&ifOutUcastPkts.2:public@localhost  
  96.  
  97.   MaxBytes[packet]: 80000000  
  98.  
  99.   Options[packet]:growright,bits  
  100.  
  101.   Title[packet]: IP Packet Count  
  102.  
  103.   PageTop[packet]:  
  104.  
  105.   YLegend[packet]: IP Packet Count  
  106.  

  3.生成首页

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

  Ubuntu下安装配置MRTG完成!

【编辑推荐】

Mrtg流量监控

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

如何使用MRTG监控CPU温度

责任编辑:zhaolei 来源: iambin
相关推荐

2011-04-02 14:21:46

MRTG安装

2011-04-01 15:00:35

2010-06-07 18:12:39

mrtg 安装

2011-03-31 09:02:22

Windows安装MRTG

2011-11-08 21:55:58

MRTG 配置

2011-03-30 15:05:40

MRTG安装

2011-09-02 14:07:59

2010-06-01 09:51:11

2011-03-31 10:26:51

安装MRTG

2010-05-28 18:57:15

Mrtg配置

2011-04-01 10:19:13

MrtgCISCO安装

2011-03-11 16:42:38

Ubuntu安装LAMP

2011-03-02 09:31:13

2011-03-02 09:31:13

2011-04-02 14:21:48

win安装MRTG

2009-07-09 15:58:40

Ubuntu JDK安

2010-06-01 10:45:02

Mrtg 安装

2011-04-02 13:47:15

Debianmrtg配置

2010-05-31 19:35:23

Ubuntu mrtg

2010-05-31 18:49:16

Ubuntu mrtg
点赞
收藏

51CTO技术栈公众号