Installation and Configuration of MRTG

Reviews
Shared by: hao nguyen
Stats
views:
58
rating:
not rated
reviews:
0
posted:
2/28/2009
language:
English
pages:
0
Installation and Configuration of MRTG MRTG (Multi Router Traffic Grapher) is a tool to monitor network traffic and can be configured to monitor other server resources i.e CPU, Memory usage, etc. MRTG basically takes regular statical information from a host and generates HTML and PNG code to display the data. The MRTG home page can be found at http://people.ee.ethz.ch/~oetiker/webtools/mrtg. The main documentation pages can be found there and also detailed installation and configuration. This document provides a quick installation and configuration of MRTG. What is required MRTG requires the following:       GNU C complier Perl gd libpng jpeg zlib Library Compilation This section details how to get and compile the above libraries. These may already be compiled on the system so skip this section. First create a directory for the compilation. # mkdir $HOME/src # cd $HOME/src Next check that gcc, perl, make, ar and ld are in your $PATH. Use which to verify. To compile zlib # wget ftp://sunsite.cnlab-switch.ch/mirror/infozip/zlib/zlib.tar.gz # gunzip –c zlib.tar.gz | tar xf – # rm zlib.tar.gz # remove to keep directory clean # cd zlib-?.?.? # ?.?.? = version number # ./configure # make # cd .. To compile jpeg Obtain the latest version # wget ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz # gunzip –c jpegsrc.v6b.tar.gz | tar xf – # rm jpegsrc.v6b.tar.gz # cd jpeg-6b # ./configure # make Installation and Configuration of MRTG # cd .. To compile libpng. Obtain the latest version # wget http://www.libpng.org/pub/png/src/libpng-1.0.11.tar.gz # gunzip –c libpng-1.0.11.tar.gz | tar xf – # rm libpng-1.0.11.tar.gz # cd libpng-1.0.11 # make –f scripts/makefile.std CC=gcc ZLIBLIB=../zlib-?.?.? ZLIBINC=../zlib-?.?.? # rm *.so.* *.so # cd .. To compile gd. # wget http://www.boutell.com/gd/http/gd-1.8.3.tar.gz # Get latest version # gunzip –c gd-1.8.3.tar.gz | tar xf – # rm gd-1.8.3.tar.gz # cd gd-1.8.3 # make INCLUDEDIRS=”-I. –I../zlib-?.?.? –I../libpng-?.?.? –I../jpeg-6b” \ LIBDIRS=”-L../zlib-?.?.? –L. –L../libpng-?.?.? –L../jpeg-6b” \ LIBS=”-lgd –lpng –lz –lm” # cd .. Now to compile and install MRTG Obtain the latest version # gunzip –c mrtg-2.9.14.tar.gz | tar xf # rm mrtg-2.9.14.tar.gz # cd mrtg-2.9.14 # ./configure –prefix=/usr/local/mrtg-2.9.14 \ --with-gd=$HOME/src/gd-1.8.3 \ --with-z=$HOME/src/zlib-1.1.3 \ --with-png=$HOME/src/png-1.0.11 # make Now su to root # make install Configuring MRTG The next step is to now configure MRTG for monitoring a network device. The below script can be run against each server to create a cfg file for MRTG to use. Create the user mrtg and the group mrtg then create the cfg directory to hold the configuration scripts and web pages. #mkdir /home/mrtg/cfg Installation and Configuration of MRTG #mkdir /home/mrtg/html #!/bin/sh PATH=$PATH:/usr/local/mrtg-2.9.14/bin; export PATH cfgmaker --global “WorkDir: /home/mrtg/html/” \ --global “Options[ _ ]: growright, bits” \ --output “/home/mrtg/cfg/-mrtg.cfg public@.tornadogroup.com” MRTG will create a cfg file for each server and place it into the /home/mrtg/cfg. If the cfg file creatation fails, there can be two possible causes.   Firewall is blocking connection Incompatible snmp on server Testing cfg scripts To test that statical information can be collected from a server, run mrtg with the cfg script. #/usr/local/mrtg-2.9.14/bin/mrtg /home/mrtg/cfg/.cfg Please note that the first couple of times errors regarding creating/moving are displayed this is normal and will disappear. If they don’t then you have a configuration problem. If the mrtg run successfully then an html file will be created displaying probably a blank chart until some stats have been collected. Point a web browser at http:///mrtg/.html, if no html page exists make sure that the cfg file points to the right location for the output. Automating MRTG Once all the cfg files have been created it’s best to automate the whole process via cron. Create a script like below to call from cron and collect the stats. /usr/local/mrtg-2.9.14/bin/mrtg /home/mrtg/cfg/.cfg /usr/local/mrtg-2.9.14/bin/mrtg /home/mrtg/cfg/.cfg /usr/local/mrtg-2.9.14/bin/mrtg /home/mrtg/cfg/.cfg etc………….. Now add to cron something like below: 5,10,15,20,25,30,35,40,45,50,55 /home/mrtg/cfg/
Shared by: hao nguyen
Other docs by hao nguyen
The Family Bed
Views: 10  |  Downloads: 0
The Crying Game
Views: 12  |  Downloads: 0
Sob Stories
Views: 0  |  Downloads: 0
Senses Of Wonder
Views: 3  |  Downloads: 0
Safe-Sleep Alert
Views: 14  |  Downloads: 0
Safe Sleep
Views: 84  |  Downloads: 0
Inside The Mind Of A Baby
Views: 11  |  Downloads: 0
How To Trim A Baby
Views: 1  |  Downloads: 0
How Does Your Baby Grow
Views: 14  |  Downloads: 0
Gear Guide for Baby
Views: 7  |  Downloads: 0
Baby Essentials
Views: 0  |  Downloads: 0
All About Ear Infections
Views: 6  |  Downloads: 0
Your New Baby
Views: 14  |  Downloads: 0
Origami
Views: 11  |  Downloads: 1
Related docs
17037486-Linux-MRTG-Configuration-HOW
Views: 166  |  Downloads: 3
MRTG The Multi Router Traffic Grapher
Views: 50  |  Downloads: 0
Installation and Configuration Guide
Views: 12  |  Downloads: 2
Installation
Views: 112  |  Downloads: 10
installation of
Views: 45  |  Downloads: 1