Welcome to MRTG
===============

> In order to MRTG build on a UNIX machine the following things are
> required.

  * a C compiler, preferably gcc or egcs 
  * a recent copy of perl, Version 5.004_4 should do -> www.perl.com

    >> in RedHat 5.2 there is a BROKEN version of Perl. Make sure you
       get an update from RedHat before continuing <<

  * the GD library from Thomas Boutell -> www.boutell.com
    (note that the following instructions assume that you are working
     in the directory above your unpacked mrtg archive.)

    >> if you have gdlib version >= 1.6 mrtg will be configured to produce
       png images. For compilation this may require you to install libz
       and libpng. See gdlib documentation for details.
    
    >> if you are not experienced with handling shared libraries,
       make sure you build static versions of libz, libpng and libgd
       in their respective documentation you will find how this is done.

       You should end-up with a lib*.a and a set of *.h files for each of
       the libraries. The instructions below are designed to cater for
       installing mrtg, and don't leave the lib*.a and *.h files in your
       favourite location. You can remove the library source directories
       after successfully compiling mrtg (rateup infact).

    >> your commands for building gd and friends might look like this:
       (if you want mrtg to produce GIF images try to get hold of a copy
        of gdlib version 1.3 or earlier. Current gd will produce PNG images.
        go to http://www.boutell.com/gd/http/)

       **** if you don't have zlib installed (linux will not need this)
         wget http://www.cdrom.com/pub/infozip/zlib/zlib.tar.gz
	 gunzip -c zlib.tar.gz | tar xf -
         mv  zlib-1.1.3/ zlib
         cd zlib
	 ./configure
	 make
         cd ..
       
       **** if you don't have libpng installed (linux will not need this)
	 wget ftp://swrinde.nde.swri.edu/pub/png/src/libpng-1.0.5.tar.gz
         gunzip -c libpng-1.0.5.tar.gz |tar xf -
         mv libpng-1.0.5 libpng
	 cd libpng
	 make -f scripts/makefile.std CC=gcc ZLIBLIB=../zlib ZLIBINC=../zlib
	 rm *.so.* *.so
	 cd ..
       
       **** if you don't have libgd
         wget http://www.boutell.com/gd/http/gd-1.7.3.tar.gz
         gunzip -c gd-1.7.3.tar.gz |tar xf -
 	 cd gd-1.7.3
	 make INCLUDEDIRS="-I../zlib -I../libpng" LIBDIRS="-L../zlib -L. -L../libpng" LIBS="-lgd -lpng -lz -lm"
	 cd ..
	
> Once all the required libraries are in place cd into the mrtg directory
> and type:
	 
  ./configure --with-gd=../gd-1.7.3 --with-z=../zlib --with-png=../libpng  

  configure will make sure your evironment is fit for building mrtg.
  If it finds a problem, it will tell you so and it will also tell
  you what todo about it. If everything is OK, you will end up with
  a custom Makefile for your system. Now type:

  make

  this builds the rateup binary and edits all the perl pathnames in
  the scripts. All the software required by MRTG is now in the run
  subdirectory.

  Copy the contents of the "run" subdirectory to your favourite
  location for the binaries of packages (eg /usr/local/bin).  It is
  now safe to delete the directories for zlib, libpng, gd.

> If you downloaded the zip archive for NT, there is a precompiled
> version of rateup in the run directory ...

The next step is to configure MRTG by writing a mrtg.cfg file. You can
either do this by hand, using the config.txt and the sample-mrtg.cfg
file in the doc subdirectory, or you can use the cfgmaker program in
the run directory.

In any case, make sure you read the mrtg documentation in the
doc subdirectory. Especially the manual.txt.

tobi oetiker <oetiker@ee.ethz.ch>
