|
Packit |
667938 |
.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29)
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.\" Standard preamble:
|
|
Packit |
667938 |
.\" ========================================================================
|
|
Packit |
667938 |
.de Sp \" Vertical space (when we can't use .PP)
|
|
Packit |
667938 |
.if t .sp .5v
|
|
Packit |
667938 |
.if n .sp
|
|
Packit |
667938 |
..
|
|
Packit |
667938 |
.de Vb \" Begin verbatim text
|
|
Packit |
667938 |
.ft CW
|
|
Packit |
667938 |
.nf
|
|
Packit |
667938 |
.ne \\$1
|
|
Packit |
667938 |
..
|
|
Packit |
667938 |
.de Ve \" End verbatim text
|
|
Packit |
667938 |
.ft R
|
|
Packit |
667938 |
.fi
|
|
Packit |
667938 |
..
|
|
Packit |
667938 |
.\" Set up some character translations and predefined strings. \*(-- will
|
|
Packit |
667938 |
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
|
Packit |
667938 |
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
|
|
Packit |
667938 |
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
|
|
Packit |
667938 |
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
|
|
Packit |
667938 |
.\" nothing in troff, for use with C<>.
|
|
Packit |
667938 |
.tr \(*W-
|
|
Packit |
667938 |
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
|
Packit |
667938 |
.ie n \{\
|
|
Packit |
667938 |
. ds -- \(*W-
|
|
Packit |
667938 |
. ds PI pi
|
|
Packit |
667938 |
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
|
Packit |
667938 |
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
|
Packit |
667938 |
. ds L" ""
|
|
Packit |
667938 |
. ds R" ""
|
|
Packit |
667938 |
. ds C` ""
|
|
Packit |
667938 |
. ds C' ""
|
|
Packit |
667938 |
'br\}
|
|
Packit |
667938 |
.el\{\
|
|
Packit |
667938 |
. ds -- \|\(em\|
|
|
Packit |
667938 |
. ds PI \(*p
|
|
Packit |
667938 |
. ds L" ``
|
|
Packit |
667938 |
. ds R" ''
|
|
Packit |
667938 |
. ds C`
|
|
Packit |
667938 |
. ds C'
|
|
Packit |
667938 |
'br\}
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.\" Escape single quotes in literal strings from groff's Unicode transform.
|
|
Packit |
667938 |
.ie \n(.g .ds Aq \(aq
|
|
Packit |
667938 |
.el .ds Aq '
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.\" If the F register is turned on, we'll generate index entries on stderr for
|
|
Packit |
667938 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
|
|
Packit |
667938 |
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
|
Packit |
667938 |
.\" output yourself in some meaningful fashion.
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.\" Avoid warning from groff about undefined register 'F'.
|
|
Packit |
667938 |
.de IX
|
|
Packit |
667938 |
..
|
|
Packit |
667938 |
.nr rF 0
|
|
Packit |
667938 |
.if \n(.g .if rF .nr rF 1
|
|
Packit |
667938 |
.if (\n(rF:(\n(.g==0)) \{
|
|
Packit |
667938 |
. if \nF \{
|
|
Packit |
667938 |
. de IX
|
|
Packit |
667938 |
. tm Index:\\$1\t\\n%\t"\\$2"
|
|
Packit |
667938 |
..
|
|
Packit |
667938 |
. if !\nF==2 \{
|
|
Packit |
667938 |
. nr % 0
|
|
Packit |
667938 |
. nr F 2
|
|
Packit |
667938 |
. \}
|
|
Packit |
667938 |
. \}
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
.rr rF
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
|
Packit |
667938 |
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
|
Packit |
667938 |
. \" fudge factors for nroff and troff
|
|
Packit |
667938 |
.if n \{\
|
|
Packit |
667938 |
. ds #H 0
|
|
Packit |
667938 |
. ds #V .8m
|
|
Packit |
667938 |
. ds #F .3m
|
|
Packit |
667938 |
. ds #[ \f1
|
|
Packit |
667938 |
. ds #] \fP
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
.if t \{\
|
|
Packit |
667938 |
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
|
Packit |
667938 |
. ds #V .6m
|
|
Packit |
667938 |
. ds #F 0
|
|
Packit |
667938 |
. ds #[ \&
|
|
Packit |
667938 |
. ds #] \&
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
. \" simple accents for nroff and troff
|
|
Packit |
667938 |
.if n \{\
|
|
Packit |
667938 |
. ds ' \&
|
|
Packit |
667938 |
. ds ` \&
|
|
Packit |
667938 |
. ds ^ \&
|
|
Packit |
667938 |
. ds , \&
|
|
Packit |
667938 |
. ds ~ ~
|
|
Packit |
667938 |
. ds /
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
.if t \{\
|
|
Packit |
667938 |
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
|
Packit |
667938 |
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
|
Packit |
667938 |
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
|
Packit |
667938 |
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
|
Packit |
667938 |
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
|
Packit |
667938 |
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
. \" troff and (daisy-wheel) nroff accents
|
|
Packit |
667938 |
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
|
Packit |
667938 |
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
|
Packit |
667938 |
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
|
Packit |
667938 |
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
|
Packit |
667938 |
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
|
Packit |
667938 |
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
|
Packit |
667938 |
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
|
Packit |
667938 |
.ds ae a\h'-(\w'a'u*4/10)'e
|
|
Packit |
667938 |
.ds Ae A\h'-(\w'A'u*4/10)'E
|
|
Packit |
667938 |
. \" corrections for vroff
|
|
Packit |
667938 |
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
|
Packit |
667938 |
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
|
Packit |
667938 |
. \" for low resolution devices (crt and lpr)
|
|
Packit |
667938 |
.if \n(.H>23 .if \n(.V>19 \
|
|
Packit |
667938 |
\{\
|
|
Packit |
667938 |
. ds : e
|
|
Packit |
667938 |
. ds 8 ss
|
|
Packit |
667938 |
. ds o a
|
|
Packit |
667938 |
. ds d- d\h'-1'\(ga
|
|
Packit |
667938 |
. ds D- D\h'-1'\(hy
|
|
Packit |
667938 |
. ds th \o'bp'
|
|
Packit |
667938 |
. ds Th \o'LP'
|
|
Packit |
667938 |
. ds ae ae
|
|
Packit |
667938 |
. ds Ae AE
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
.rm #[ #] #H #V #F C
|
|
Packit |
667938 |
.\" ========================================================================
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.IX Title "MRTG-UNIX-GUIDE 1"
|
|
Packit |
667938 |
.TH MRTG-UNIX-GUIDE 1 "2018-07-13" "2.17.7" "mrtg"
|
|
Packit |
667938 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
|
Packit |
667938 |
.\" way too many mistakes in technical documents.
|
|
Packit |
667938 |
.if n .ad l
|
|
Packit |
667938 |
.nh
|
|
Packit |
667938 |
.SH "NAME"
|
|
Packit |
667938 |
mrtg\-unix\-guide \- The MRTG 2.17.7 Linux/Unix Installation Guide
|
|
Packit |
667938 |
.SH "DESCRIPTION"
|
|
Packit |
667938 |
.IX Header "DESCRIPTION"
|
|
Packit |
667938 |
\&\s-1MRTG\s0 comes to you in Source Code. This means that you have to compile
|
|
Packit |
667938 |
parts of it before you can use it on a Unix machine. These instructions
|
|
Packit |
667938 |
help you to do so.
|
|
Packit |
667938 |
.SH "PREPARATION"
|
|
Packit |
667938 |
.IX Header "PREPARATION"
|
|
Packit |
667938 |
In order to compile and use mrtg you need a C compiler and a copy of perl
|
|
Packit |
667938 |
installed on your machine. In most cases this will already be available.
|
|
Packit |
667938 |
In case it is not, here are some starting points. Below I'll give you
|
|
Packit |
667938 |
a detailed run through the whole compilation process.
|
|
Packit |
667938 |
.IP "\s-1GCC\s0" 4
|
|
Packit |
667938 |
.IX Item "GCC"
|
|
Packit |
667938 |
The \s-1GNU C\s0 compiler comes preinstalled on most of the free Unicies out
|
|
Packit |
667938 |
there. For commercial derivatives you may have to download and compile
|
|
Packit |
667938 |
it first. If you have no compiler at all there is a chicken and egg
|
|
Packit |
667938 |
problem, but there are also precompiled versions of gcc available for
|
|
Packit |
667938 |
most operating systems.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& http://gcc.gnu.org/
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.IP "Perl" 4
|
|
Packit |
667938 |
.IX Item "Perl"
|
|
Packit |
667938 |
Large parts of the \s-1MRTG\s0 system are written in the Perl scripting language.
|
|
Packit |
667938 |
Make sure there is a recent copy of perl on your machine (try perl \-v). At
|
|
Packit |
667938 |
least version 5.005 is required for mrtg to work well. If you use \s-1SNMPV3\s0 and
|
|
Packit |
667938 |
other new features you should use at least 5.8.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
You can get the latest perl from
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& http://www.perl.com/
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\&\s-1MRTG\s0 generates traffic graphs in the \s-1PNG\s0 format. To be able to do this it
|
|
Packit |
667938 |
needs several 3rd party libraries. When compiling these libraries I urge you
|
|
Packit |
667938 |
to make sure you compile them as \fBstatic\fR libraries. There is just much
|
|
Packit |
667938 |
less trouble ahead if you are doing it like this. See the Instructions in
|
|
Packit |
667938 |
the next section for inspiration. Note that many free unices have all
|
|
Packit |
667938 |
the required libraries already in place so there is no need to install
|
|
Packit |
667938 |
another copy. To check it is best to skip all the library instructions below
|
|
Packit |
667938 |
and go straight into the mrtg compile.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
If the first attempt fails and you do not get a working version of mrtg,
|
|
Packit |
667938 |
try compiling new copies of all libraries as explained below. Do this
|
|
Packit |
667938 |
\&\fB\s-1BEFORE\s0\fR you send email to me about problems compiling mrtg.
|
|
Packit |
667938 |
.IP "gd" 4
|
|
Packit |
667938 |
.IX Item "gd"
|
|
Packit |
667938 |
This is a basic graph drawing library created by Thomas Boutell.
|
|
Packit |
667938 |
Note that all releases after Version 1.3 only create
|
|
Packit |
667938 |
\&\s-1PNG\s0 images. This is because a) Thomas got into trouble because the \s-1GIF\s0
|
|
Packit |
667938 |
format which it used to produce uses a compression technology patented
|
|
Packit |
667938 |
by Unisys. b) \s-1PNG\s0 is more efficient and patent free. \s-1MRTG\s0 can work
|
|
Packit |
667938 |
with old and new version of the \s-1GD\s0 library. You can get a recent copy
|
|
Packit |
667938 |
of \s-1GD\s0 from:
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& http://www.boutell.com/gd/
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.IP "libpng" 4
|
|
Packit |
667938 |
.IX Item "libpng"
|
|
Packit |
667938 |
Is required by gd in order to produce \s-1PNG\s0 graphics files. Get it from:
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& http://www.libpng.org/pub/png/libpng.html
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.IP "zlib" 4
|
|
Packit |
667938 |
.IX Item "zlib"
|
|
Packit |
667938 |
Is needed by libpng to compress the graphics files you create.
|
|
Packit |
667938 |
Get a copy from
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& http://www.gzip.org/zlib
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
And last but not least you also need mrtg itself. In case you have not
|
|
Packit |
667938 |
yet downloaded it, you can find a copy on my website:
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& http://oss.oetiker.ch/mrtg/pub
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.SH "LIBRARY COMPILATION"
|
|
Packit |
667938 |
.IX Header "LIBRARY COMPILATION"
|
|
Packit |
667938 |
In this section I will give you step by step instructions on how to compile
|
|
Packit |
667938 |
the various libraries required for the compilation of mrtg. Note that these
|
|
Packit |
667938 |
libraries may already be installed if you have a \fI*BSD\fR or \fILinux\fR system
|
|
Packit |
667938 |
so you can skip recompiling them. The \fBwget\fR program used below is a
|
|
Packit |
667938 |
simple web downloader. You can also enter the address into your \fBnetscape\fR
|
|
Packit |
667938 |
if you don't have \fBwget\fR available.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
First let's create a directory for the compilation. Note that this may
|
|
Packit |
667938 |
already exist on your system. No problem, just use it.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 2
|
|
Packit |
667938 |
\& mkdir \-p /usr/local/src
|
|
Packit |
667938 |
\& cd /usr/local/src
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
If you do not have zlib installed:
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 8
|
|
Packit |
667938 |
\& wget http://www.zlib.net/zlib\-1.2.3.tar.gz
|
|
Packit |
667938 |
\& gunzip \-c zlib\-*.tar.gz | tar xf \-
|
|
Packit |
667938 |
\& rm zlib\-*.tar.gz
|
|
Packit |
667938 |
\& mv zlib\-* zlib
|
|
Packit |
667938 |
\& cd zlib
|
|
Packit |
667938 |
\& ./configure
|
|
Packit |
667938 |
\& make
|
|
Packit |
667938 |
\& cd ..
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
If you don't have libpng installed
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 8
|
|
Packit |
667938 |
\& wget ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng\-1.2.40.tar.gz
|
|
Packit |
667938 |
\& gunzip \-c libpng\-1.2.34.tar.gz | tar xf \-
|
|
Packit |
667938 |
\& mv libpng\-* libpng
|
|
Packit |
667938 |
\& cd libpng
|
|
Packit |
667938 |
\& env CFLAGS="\-O3 \-fPIC" ./configure \-\-prefix=$INSTALL_DIR
|
|
Packit |
667938 |
\& make
|
|
Packit |
667938 |
\& rm *.so.* *.so
|
|
Packit |
667938 |
\& cd ..
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
And now you can compile gd
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
For versions up to 1.8.4, try:
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 5
|
|
Packit |
667938 |
\& wget http://www.boutell.com/gd/http/gd\-1.8.4.tar.gz
|
|
Packit |
667938 |
\& gunzip \-c gd\-*.tar.gz |tar xf \-
|
|
Packit |
667938 |
\& rm gd\-*.tar.gz
|
|
Packit |
667938 |
\& mv gd\-* gd
|
|
Packit |
667938 |
\& cd gd
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
The \e characters at the end of the following lines mean that all the
|
|
Packit |
667938 |
following material should actually be written on a single line.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 6
|
|
Packit |
667938 |
\& perl \-i~ \-p \-e s/gd_jpeg.o//g Makefile
|
|
Packit |
667938 |
\& make INCLUDEDIRS="\-I. \-I../zlib \-I../libpng" \e
|
|
Packit |
667938 |
\& LIBDIRS="\-L../zlib \-L. \-L../libpng" \e
|
|
Packit |
667938 |
\& LIBS="\-lgd \-lpng \-lz \-lm" \e
|
|
Packit |
667938 |
\& CFLAGS="\-O \-DHAVE_LIBPNG"
|
|
Packit |
667938 |
\& cd ..
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
For versions starting around 2.0.11, try:
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 8
|
|
Packit |
667938 |
\& wget http://www.boutell.com/gd/http/gd\-2.0.33.tar.gz
|
|
Packit |
667938 |
\& gunzip \-c gd\-2.0.33.tar.gz |tar xf \-
|
|
Packit |
667938 |
\& mv gd\-2.0.33 gd
|
|
Packit |
667938 |
\& cd gd
|
|
Packit |
667938 |
\& env CPPFLAGS="\-I../zlib \-I../libpng" LDFLAGS="\-L../zlib \-L../libpng" \e
|
|
Packit |
667938 |
\& ./configure \-\-disable\-shared \-\-without\-freetype \-\-without\-jpeg
|
|
Packit |
667938 |
\& make
|
|
Packit |
667938 |
\& cp .libs/* .
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.SH "MRTG COMPILATION"
|
|
Packit |
667938 |
.IX Header "MRTG COMPILATION"
|
|
Packit |
667938 |
Ok, now everything is ready for the mrtg compilation.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 3
|
|
Packit |
667938 |
\& cd /usr/local/src
|
|
Packit |
667938 |
\& gunzip \-c mrtg\-2.17.7.tar.gz | tar xvf \-
|
|
Packit |
667938 |
\& cd mrtg\-2.17.7
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
If all the libraries have been preinstalled on your system you can
|
|
Packit |
667938 |
configure mrtg by doing a simple:
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& ./configure \-\-prefix=/usr/local/mrtg\-2
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Otherwise you may have to give some hints on where to find the
|
|
Packit |
667938 |
various libraries required to compile mrtg:
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 4
|
|
Packit |
667938 |
\& ./configure \-\-prefix=/usr/local/mrtg\-2 \e
|
|
Packit |
667938 |
\& \-\-with\-gd=/usr/local/src/gd \e
|
|
Packit |
667938 |
\& \-\-with\-z=/usr/local/src/zlib \e
|
|
Packit |
667938 |
\& \-\-with\-png=/usr/local/src/libpng
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
If you have RRDtool available you might want to tell mrtg about it
|
|
Packit |
667938 |
so that you can opt to use rrdtool with mrtg. Check mrtg-rrd.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Configure will make sure your environment is fit for building mrtg.
|
|
Packit |
667938 |
If it finds a problem, it will tell you so and it will also tell
|
|
Packit |
667938 |
you what to do about it. If everything is \s-1OK,\s0 you will end up with
|
|
Packit |
667938 |
a custom Makefile for your system. Now type:
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& make
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
This builds the rateup binary and edits all the perl pathnames in
|
|
Packit |
667938 |
the scripts. You can now install mrtg by typing
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& make install (requires gnu install)
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
All the software required by \s-1MRTG\s0 is now installed under
|
|
Packit |
667938 |
the \fI/usr/local/mrtg\-2\fR subdirectory.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
You can now safely delete the libraries we compiled above. Then
|
|
Packit |
667938 |
again, you might want to keep them around so that you have them
|
|
Packit |
667938 |
available when compiling the next version of mrtg.
|
|
Packit |
667938 |
.SH "CONFIGURATION"
|
|
Packit |
667938 |
.IX Header "CONFIGURATION"
|
|
Packit |
667938 |
The next step is to configure mrtg for monitoring a network
|
|
Packit |
667938 |
device. This is done by creating an \fImrtg.cfg\fR file which defines
|
|
Packit |
667938 |
what you want to monitor. Luckily, you don't have to dive straight in
|
|
Packit |
667938 |
and start writing your own configuration file all by
|
|
Packit |
667938 |
yourself. Together with mrtg you also got a copy of \fBcfgmaker\fR. This
|
|
Packit |
667938 |
is a script you can point at a router of your choice; it will
|
|
Packit |
667938 |
create a mrtg configuration file for you. You can find the script in
|
|
Packit |
667938 |
the \fIbin\fR subdirectory.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 4
|
|
Packit |
667938 |
\& cfgmaker \-\-global \*(AqWorkDir: /home/httpd/mrtg\*(Aq \e
|
|
Packit |
667938 |
\& \-\-global \*(AqOptions[_]: bits,growright\*(Aq \e
|
|
Packit |
667938 |
\& \-\-output /home/mrtg/cfg/mrtg.cfg \e
|
|
Packit |
667938 |
\& community@router.abc.xyz
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
This example above will create an mrtg config file in
|
|
Packit |
667938 |
\&\fI/home/mrtg/cfg\fR assuming this is a directory visible on your
|
|
Packit |
667938 |
webserver. You can read all about cfgmaker in cfgmaker. One area you might
|
|
Packit |
667938 |
want to look at is the possibility of using \fB\-\-ifref=ip\fR to prevent
|
|
Packit |
667938 |
interface renumbering troubles from catching you.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
If you want to start rolling your own mrtg configuration files, make sure
|
|
Packit |
667938 |
you read mrtg-reference to learn all about the possible configuration options.
|
|
Packit |
667938 |
.SH "RUNNING MRTG"
|
|
Packit |
667938 |
.IX Header "RUNNING MRTG"
|
|
Packit |
667938 |
Once you have created a configuration file, try the following:
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& /usr/local/mrtg\-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
This will query your router and also create your first mrtg trafic
|
|
Packit |
667938 |
graphs and webpages. When you run mrtg for the first time there will
|
|
Packit |
667938 |
be a lot of complaints about missing log files. Don't worry, this is
|
|
Packit |
667938 |
normal for the first 2 times you start mrtg. If it keeps complaining
|
|
Packit |
667938 |
after this time you might want to look into the problem.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Starting mrtg by hand is not ideal in the long run. So when you are
|
|
Packit |
667938 |
satisfied with the results you can automate the process of running mrtg in
|
|
Packit |
667938 |
regular intervals (this means every 5 minutes by default).
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
You can either add mrtg to your crontab with a line like this:
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 3
|
|
Packit |
667938 |
\& 0,5,10,15,20,25,30,35,40,45,50,55 * * * * \e
|
|
Packit |
667938 |
\& <mrtg\-bin>/mrtg <path to mrtg\-cfg>/mrtg.cfg \e
|
|
Packit |
667938 |
\& \-\-logging /var/log/mrtg.log
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
or if you live in Linux Land the line may look like this if you are
|
|
Packit |
667938 |
using \f(CW\*(C`crontab \-e\*(C'\fR
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 2
|
|
Packit |
667938 |
\& */5 * * * * <mrtg\-bin>/mrtg <path to mrtg\-cfg>/mrtg.cfg \e
|
|
Packit |
667938 |
\& \-\-logging /var/log/mrtg.log
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
or like this if you use \fI/etc/crontab\fR
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 2
|
|
Packit |
667938 |
\& */5 * * * * mrtg\-user <mrtg\-bin>/mrtg <path to mrtg\-cfg>/mrtg.cfg \e
|
|
Packit |
667938 |
\& \-\-logging /var/log/mrtg.log
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
You can also run mrtg as a daemon process by adding the line
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& RunAsDaemon: Yes
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
to your mrtg configuration file and then creating a startup script in
|
|
Packit |
667938 |
your system startup sequence. Unfortunately, adding startup scripts
|
|
Packit |
667938 |
differs widely amongst different unix systems. The modern ones normally
|
|
Packit |
667938 |
have a directory called \fI/etc/init.d\fR or \fI/etc/rc.d/init.d\fR where you
|
|
Packit |
667938 |
put scripts which starts the process you want to run when the system
|
|
Packit |
667938 |
boots. Further you must create a symbolic link in \fI/etc/rc3.d\fR or
|
|
Packit |
667938 |
\&\fI/etc/rc.d/rc?.d\fR called \fIS65mrtg\fR (this is just a sample name
|
|
Packit |
667938 |
\&... it is just important that it starts with S followed by a two digit
|
|
Packit |
667938 |
number). If you are not sure about this, make sure you consult the
|
|
Packit |
667938 |
documentation of your system to make sure you get this right.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
A \fBminimal\fR script to put into \fIinit.d\fR might look like this:
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 3
|
|
Packit |
667938 |
\& #! /bin/sh
|
|
Packit |
667938 |
\& cd /usr/local/mrtg\-2.17.7/bin && ./mrtg \-\-user=mrtg\-user \e
|
|
Packit |
667938 |
\& /home/httpd/mrtg/mrtg.cfg \-\-logging /var/log/mrtg.log
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Note that this will only work with \fBRunAsDaemon: Yes\fR in your
|
|
Packit |
667938 |
mrtg.cfg file.
|
|
Packit |
667938 |
.SH "AUTHOR"
|
|
Packit |
667938 |
.IX Header "AUTHOR"
|
|
Packit |
667938 |
Tobias Oetiker <tobi@oetiker.ch>
|