国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

史上最詳細的mrtg(Multi Router Traffic Grapher)設置說明

2020-07-10 11:53:11
字體:
來源:轉載
供稿:網友
Multi Router Traffic Grapher------MRTG是一個監控網絡鏈路流量負載的工具軟件,通過snmp協議得到設備的流量信息,并將流量負載以包含PNG格式的圖形的HTML 文檔方式顯示給用戶,以非常直觀的形式顯示流量負載。

一、前期準備

(1)MRTG需要以SNMP服務為基礎,所以請確保你的系統已經啟用了此服務,修改SNMP的配置:
#vi /etc/snmp/snmpd.conf
將62行:
access notConfigGroup "" any noauth exact systemview none none
改為
access notConfigGroup "" any noauth exact mib2 none none
把第89行前面的注釋符號#去掉,變成
view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc

(2)linux Mrtg監控主機流量啟動http服務和snmp服務:
首先查看兩個服務在系統啟動時是否已經開啟
#chkconfig --list | grep nginx
沒有啟動的話需要修改下在什么啟動模式下要自己啟動:
# chkconfig --level 35 nginx on
對 snmpd 服務采用同樣的設置,現在手動啟動下
#service nginx start
#service snmpd start
啟動之后最好是用setup配置服務,讓其隨機自動啟動

查看端口的開啟狀況也可確認其是否已經被啟動
# netstat -tunlp |grep snmp
tcp 0 0 0.0.0.0:199 0.0.0.0:* LISTEN 4973/snmpd
udp 0 0 0.0.0.0:161 0.0.0.0:* 4973/snmpd

(3)MRTG生成供瀏覽圖像需要http服務的支持,同時也需要gd、libpng和zlib三個軟件包的支持,而gd的正常運行也需要其它的幾個軟件,(系統默認自帶,如果沒有自帶則需要我們手工安裝)
1.安裝zlib-1.2.3
#tar zxvf zlib-1.2.3.tar.gz
#cd zlib-1.2.3
#./configure --prefix=/usr/local/zlib
#make
#make install

2.安裝httpd-2.2.4
#tar zxvf httpd-2.2.4.tar.gz
#cd httpd-2.2.4
#./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-track-vars --enable-rewrite --with-z-dir=/usr/local/zlib
#make
#make install
啟動httpd
/usr/local/apache/bin/apachectl -k start

3.安裝libpng-1.2.14
#tar zxvf libpng-1.2.14.tar.gz
# cd libpng-1.2.14
# cp scripts/makefile.linux makefile
# make (若是提示找不到zlib庫文件或者頭文件,多半是makefile文件里zlib的默認路徑有誤。可編輯makefile文件,找到zlib項并重新指定路徑到/usr/local/zlib/lib和/usr/local/zlib/include)。
# make install

4.安裝freetype-2.1.10
# tar -zvxf freetype-2.1.10.tar.gz
# cd freetype-2.1.10
# mkdir -p /usr/local/freetype
# ./configure --prefix=/usr/local/freetype
# make;make install

5.安裝jpegsrc.v6b
jpeg默認不會自建目錄,因此需手動建立目錄:
# mkdir -pv /usr/local/jpeg6/{,bin,lib,include,man/{,man1},man1}
安裝
#tar zxvf jpegsrc.v6b.tar.gz
# ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
# make
# make install
# make install-lib

6.安裝libxml2-2.6.19
# tar -zxf libxml2-2.6.19.tar.gz
# cd libxml2-2.6.19
# mkdir -p /usr/local/libxml2
# ./configure --prefix=/usr/local/libxml2
# make; make install
#cp xml2-config /usr/bin

7.安裝GD-2.0.33庫
# tar -zvxf gd-2.0.33.tar.gz
# mkdir -p /usr/local/gd2
# cd gd-2.0.33
# ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6/ --with-png=/usr/local/lib/ --with-zlib=/usr/local/zlib/ --with-freetype=/usr/local/freetype/
# make
# make install

(4)修改系統語言配置
#vi /etc/profile
增加如下兩行
LC_ALL=C
LANGUAGE=on

二、開始安裝

(1)開始安裝mrtg
#cd /usr/local/src
#wget http://oss.oetiker.ch/mrtg/pub/mrtg-2.14.5.tar.gz
#tar zvxf mrtg-2.14.5.tar.gz
#cd mrtg-2.14.5
#./configure --prefix=/usr/local/mrtg 注意:“--prefix=/usr/local/mrtg”是指定的安裝路徑
#make
#make install

(2)配置MRTG
首先為mrtg的主頁在web目錄下建立一個目錄,假如web目錄是:/home/wwwroot/
在此目錄下新建目錄mrtg和sh即:
#cd /home/wwwroot/
#mkdir mrtg
#cd mrtg
#mkdir sh

如果路徑嫌長感到不方便的話可以建立軟連接:
#cd /
#ln –s /home/wwwroot/mrtg _mrtg
#ln –s /usr/local/mrtg/bin _mrtgbin

把一些圖片 主站蜘蛛池模板: 梅河口市| 石景山区| 岱山县| 洱源县| 江北区| 肇东市| 南投市| 绍兴市| 泰来县| 竹山县| 明光市| 法库县| 宁明县| 都昌县| 舟山市| 太仓市| 旬邑县| 泰安市| 延安市| 长治县| 沂源县| 元谋县| 和静县| 民权县| 那坡县| 渑池县| 通渭县| 斗六市| 琼海市| 武夷山市| 如皋市| 彰化市| 凌海市| 安塞县| 宁乡县| 万全县| 景谷| 永和县| 洪雅县| 武陟县| 安仁县|