MRTG安装和配置 centos 安装mrtg

Mrtg是一个通过snmp监控网络链路流量的工具软件
它通过snmp协议从设备得到设备的流量信息,
并将流量负载以PNG格式的图形的HTML文档方式显示给用户,以非常直观的形式显示流量负载


mrtg preinstall
# perl -v

This is perl, v5.8.6 built for i386-linux-thread-multi

Copyright 1987-2004, Larry Wall
a basic graph drawing library

# rpm -qa | grep gd
gd-2.0.33-2
gd-devel-2.0.33-2
# rpm -qa | grep libpng
libpng10-devel-1.0.18-2
libpng-1.2.8-2
libpng-devel-1.2.8-2
libpng10-1.0.18-2
# rpm -qa | grep zlib
zlib-1.2.2.2-3
zlib-devel-1.2.2.2-3



MRTG安装
[root@localhost mrtg-2.15.1]# ls
binconfig.h.in configure.inCOPYINGdocimageslibMakefile.NetWareMANIFESTREADME THANKS
CHANGESconfigurecontribCOPYRIGHT get_ver.awkinstall-sh Makefile.inMakefile.Win32mkinstalldirssrctranslate

[root@localhost mrtg-2.15.1]# ./configure--prefix=/usr/local/mrtg-2
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for stdint.h... yes
checking for unistd.h... yes
checking for inttypes.h... (cached) yes
checking for unsigned long long... yes
checking for long long... yes
checking for strtoll... yes
checking for printf long long format specifier... %lld
checking for pow in -lm... yes
checking for gdImageGif in -lgd... yes
checking for gdImagePng in -lgd... yes
checking for gdImagePng_jpg in -lgd... no需要安装JPEG库
安装jpeg库
tar -zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b
./configure --enable-static --enable-shared --prefix=/usr
make
make install
重新configure
[root@localhost mrtg-2.15.1]# ./configure--prefix=/usr/local/mrtg-2
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for stdint.h... yes
checking for unistd.h... yes
MRTG安装和配置 centos 安装mrtg
checking for inttypes.h... (cached) yes
checking for unsigned long long... yes
checking for long long... yes
checking for strtoll... yes
checking for printf long long format specifier... %lld
checking for pow in -lm... yes
checking for gdImageGif in -lgd... yes
checking for gdImagePng in -lgd... yes
checking for gdImagePng_jpg in -lgd... yes
checking for gdImagePng_jpg_ft in -lgd... no
checking for gdImageGd in -lgd... yes
checking gd.h usability... yes
config.status: creating config.h
ordering CD from http://people.ee.ethz.ch/~oetiker/wish .... justkidding ;-)
----------------------------------------------------------------
Config is DONE!
Type 'make' to compile the software
# make
/usr/bin/perl -0777 -p -i~ -e "s'^#!s*/S*perl'#! /usr/bin/perl'"./bin/cfgmaker ./bin/indexmaker ./bin/mrtg
/usr/bin/perl -0777 -p -i~ -e 's@GRAPHFMT="...";@GRAPHFMT="png";@'./bin/mrtg ./bin/indexmaker
# make install
/usr/bin/perl -0777 -p -i~ -e "s'^#!s*/S*perl'#! /usr/bin/perl'"./bin/cfgmaker ./bin/indexmaker ./bin/mrtg
/usr/bin/perl -0777 -p -i~ -e 's@GRAPHFMT="...";@GRAPHFMT="png";@'./bin/mrtg ./bin/indexmaker
/bin/sh ./mkinstalldirs /usr/local/mrtg-2/bin
for x in ./bin/mrtg ./bin/cfgmaker ./bin/indexmaker./bin/mrtg-traffic-sum; do
/usr/bin/install -c -m 755 $x/usr/local/mrtg-2/bin; done
for x in bin/rateup; do
/usr/bin/install -c -m 755 $x/usr/local/mrtg-2/bin; done
/bin/sh ./mkinstalldirs /usr/local/mrtg-2/lib/mrtg2/Pod
for x in ./lib/mrtg2/*.pm; do
/usr/bin/install -c -m 644 $x/usr/local/mrtg-2/lib/mrtg2; done
for x in ./lib/mrtg2/Pod/*.pm; do
/usr/bin/install -c -m 644 $x/usr/local/mrtg-2/lib/mrtg2/Pod; done
/bin/sh ./mkinstalldirs /usr/local/mrtg-2/share/mrtg2/icons
for x in ./images/*.gif ./images/*.png; do
/usr/bin/install -c -m 644 $x/usr/local/mrtg-2/share/mrtg2/icons; done
/bin/sh ./mkinstalldirs /usr/local/mrtg-2/share/doc/mrtg2
(cd .; for x in COPYING COPYRIGHT README CHANGES THANKS doc/*.poddoc/*.txt doc/*.png; do
/usr/bin/install -c -m 644 $x/usr/local/mrtg-2/share/doc/mrtg2; done)
/bin/sh ./mkinstalldirs /usr/local/mrtg-2/man/man1
for x in ./doc/*.1; do
/usr/bin/install -c -m 644 $x/usr/local/mrtg-2/man/man1; done



MRTG运行
snmp-server community publicRO
snmp-server enable traps tty

------------------------------------------
$ mkdir -p/home/macg/www/mrtg/cfg事先建立mrtg工作目录
此工作目录因为要放html文件,因此最好放在wwwroot目录下
-----------------------------------------
$ su
Password:可惜cfgmaker等操作,都必须在root下执行

----------------------------------------
# /usr/local/mrtg-2/bin/cfgmaker --global 'WorkDir: /home/macg/www/mrtg' --global'Options[_]: bits,growright' --output/home/macg/www/mrtg/cfg/mrtg.cfg public@192.168.1.150
这条长语句,必须一气呵成执行

--global参数: 表示后面的选项是对后面指定的设备都是有效的
(如果希望对多个设备进行监控时,该参数就会发生作用)

--ifref : 用来指示用什么选项来标识设备接口
--ifref=ip 使用IP地址来标识网络设备接口。
一般来说ip地址是唯一的
但是有些情况下接口是没有IP地址的,例如switch, 要用—ifref=nr

--base: GetDevice Info on public@192.168.1.150:
--base: Vendor Id: cisco
--base: Populating confcache
--coca: populate confcache public@192.168.1.150:
--coca: store in confcache public@192.168.1.150_ Name Et0--> 1
--coca: store in confcache public@192.168.1.150_ Name Se0--> 2
--coca: store in confcache public@192.168.1.150_ Name Se1--> 3
--coca: store in confcache public@192.168.1.150_ Name Nu0--> 4
--coca: store in confcache public@192.168.1.150_ Name Lo0--> 5
--coca: store in confcache public@192.168.1.150_ Name Lo1--> 6

--base: Get Interface Info
--base: Walking ifIndex
--base: Walking ifType
--base: Walking ifSpeed
--base: Writing /home/macg/www/mrtg/cfg/mrtg.cfg
--------------------------------------------------------------------------------
# /usr/local/mrtg-2/bin/mrtg /home/macg/www/mrtg/cfg/mrtg.cfg
-----------------------------------------------------------------------
ERROR: Mrtg will most likely not work properly when theenvironment
variable LANG is set to UTF-8. Please run mrtg in anenvironment
where this is not the case. Try the following command tostart:

env LANG=C /usr/local/mrtg-2/bin/mrtg/home/macg/www/mrtg/cfg/mrtg.cfg
-----------------------------------------------------------------------
处理.cfg图,必须先(临时,env命令代表临时)设置语言环境变量为C(标准ASCII环境语言),而通常LANG=LANG=en_US.UTF-8(英文)或LANG=zh(中文)
# env LANG=C/usr/local/mrtg-2/bin/mrtg /home/macg/www/mrtg/cfg/mrtg.cfg
2007-02-15 18:47:44, Rateup WARNING: /usr/local/mrtg-2/bin/rateupcould not read the primary log file for 192.168.1.150_1
2007-02-15 18:47:44, Rateup WARNING: /usr/local/mrtg-2/bin/rateupThe backup log file for 192.168.1.150_1 was invalid as well
2007-02-15 18:47:44, Rateup WARNING: /usr/local/mrtg-2/bin/rateupCan't remove 192.168.1.150_1.old updating log file
2007-02-15 18:47:44, Rateup WARNING: /usr/local/mrtg-2/bin/rateupCan't rename 192.168.1.150_1.log to 192.168.1.150_1.old updatinglog file
# ls -l /home/macg/www/mrtg
-rw-r--r-- 1 root root 1470 Feb15 18:47 192.168.1.150_1-day.png
-rw-r--r-- 1 root root 6349 Feb15 18:47 192.168.1.150_1.html
-rw-r--r-- 1 root root 48189 Feb 15 18:47192.168.1.150_1.log
-rw-r--r-- 1 root root 1370 Feb15 18:47 192.168.1.150_1-month.png
-rw-r--r-- 1 root root 1449 Feb15 18:47 192.168.1.150_1-week.png
-rw-r--r-- 1 root root 1724 Feb15 18:47 192.168.1.150_1-year.png
drwxrwxr-x 2 macgmacg 4096 Feb 15 18:47 cfg
-rw-r--r-- 1 rootroot 538 Feb 14 21:55mrtg-l.png
-rw-r--r-- 1 rootroot 414 Feb 14 21:55mrtg-m.png
-rw-r--r-- 1 root root 1759 Feb14 21:55 mrtg-r.png
# /usr/local/mrtg-2/bin/indexmaker--output=/home/macg/www/mrtg/index.html/home/macg/www/mrtg/cfg/mrtg.cfg

# ls -l /home/macg/www/mrtg
-rw-r--r-- 1 root root 1470 Feb15 18:47 192.168.1.150_1-day.png
-rw-r--r-- 1 root root 6349 Feb15 18:47 192.168.1.150_1.html
-rw-r--r-- 1 root root 48189 Feb 15 18:47192.168.1.150_1.log
-rw-r--r-- 1 root root 1370 Feb15 18:47 192.168.1.150_1-month.png
-rw-r--r-- 1 root root 1449 Feb15 18:47 192.168.1.150_1-week.png
-rw-r--r-- 1 root root 1724 Feb15 18:47 192.168.1.150_1-year.png
drwxrwxr-x 2 macg macg 4096 Feb15 18:47 cfg
-rw-r--r-- 1 root root 2564 Feb15 18:49 index.html
-rw-r--r-- 1 rootroot 538 Feb 14 21:55mrtg-l.png
-rw-r--r-- 1 rootroot 414 Feb 14 21:55mrtg-m.png
-rw-r--r-- 1 root root 1759 Feb14 21:55 mrtg-r.png









  

爱华网本文地址 » http://www.aihuau.com/a/25101016/288426.html

更多阅读

LINUX操作系统VIM的安装和配置 linux中vim基本操作

LINUX操作系统VIM的安装和配置——简介VI是LINUX下最老牌的编辑工具,而VIM则是VI的升级版本,LINUX系统必备啊。LINUX操作系统VIM的安装和配置——工具/原料LINUX操作系统(ubuntu/Centos)LINUX操作系统VIM的安装和配置——VIM的安装

ADT的下载和配置 adt配置sdk路径

ADT的下载和配置——简介ADT:Android Development Tools, Eclipse的Android 开发插件,把Eclipse和SDK联系起来。ADT的下载和配置——工具/原料SDK环境ADTADT的下载和配置——方法/步骤ADT的下载和配置 1、可在各大型软件网载ADT,在Ecli

Win7专业版iis安装和配置 win7专业版安装语言包

控制面板——程序和功能——打开或关闭Windows功能根据需要设置Internet管理服务下的Web管理工具和万维网服务:ps:一般都是默认设置好的,如是在本机上测试的,就不用动其它什么的了,只须选上这几个:“web管理

Linux下搭建DNS服务器和配置文件named.conf 祥解 named checkconf

2011 年 11 月 17 日 by 天明 | 暂无评论 | 559阅配置之前先了解一下BIND DNS服务器软件:BIND是一种开源的DNS(Domain Name System)协议的实现,包含对域名的查询和响应所需的所有软件。它是互联网上最广泛使用的一种DNS服务器,对于类Unix

声明:《MRTG安装和配置 centos 安装mrtg》为网友秋凉瑾言分享!如侵犯到您的合法权益请联系我们删除