INSTALLATION GUIDE
------------ -----

INTRODUCTION

The rmrtgc program runs on the machine running MRTG. It's written in perl
so it should run on Unix and Windows systems, just like MRTG itself.
Which is lucky.

The rmrtg program runs on the remote machine that you want to monitor.
It's designed to run under inetd, so I'm not sure if that's
any use for Windows. But it's great for Unix.


MAKEFILE

A Makefile is supplied, and it will install the programs in the default places
(assuming you tweak the Makefile in the right place) and make the needed
directories. But, you'll still have to play with inetd.conf and mrtg.cfg
yourself.


EXAMPLE

Example: Imagine 2 machines - atlas is the MRTG monitoring box,
pandora is a development server. We want atlas to monitor
things on pandora like CPU usage, number of users...


REMOTE HOST (Pandora - A Unix box)

I recommend that you create a user just for MRTG. This
gives you /home/mrtg - now create /home/mrtg/bin because
that's the directory where your MRTG plugins will go.

Create /home/mrtg/ext and put 'rmrtg' in there.
You should open up rmrtg and check the shebang line,
and check that "$commanddir = '/home/mrtg/bin/';" to ensure
it matches the directory where you will put your commands.

Add in any MRTG plugin commands that you will be using on
this machine into that bin/ directory. You just need the
commands, not MRTG itself. Note that these must be
plain executable files, not symlinks.

Finally create /home/mrtg/tmp with permissions such that 
the mrtg user can write to it. Temp files and lockfiles go in there.

Adjust pandora's inetd.conf file by adding:

rmrtg   stream  tcp     nowait  mrtg    /usr/sbin/tcpd /home/mrtg/ext/rmrtg
or
rmrtg   stream  tcp     nowait  mrtg    /home/mrtg/ext/rmrtg	rmrtg

as appropriate to your setup. I use a username of mrtg, but your system
may use some kind of 'admin' or 'sysadmin' user. Make sure the 
permissions on the /home/mrtg/* directories reflect this.

Adjust /etc/services by adding a line like this:

rmrtg           5660/tcp        # remote MRTG external commands

but you can use whatever port you, or your admin, think is best -
but make sure that port is OK for usage.
Then HUP inetd. The machine should now be listening on port 5660
(or whatever you configured) ready to give out status checks.
If you use a different port you'll need to change the default port
in rmrtgc.

MRTG MONITORING SERVER (Atlas - Unix or Windows)

I personally have an mrtg user on this machine too. This machine will
be acting as a client for rmrtg, so you put 'rmrtgc' somewhere that
MRTG can get at it - e.g. /home/mrtg/ext/rmrtgc

Make a new target in your mrtg.cfg file - in this example for
pandora's load average:

Target[pandora.load]: `/home/mrtg/ext/rmrtgc pandora loadavg.pl -n`
# and the usual stuff follows

On Windows, you will probably need this form:
Target[pandora.load]: `perl d:\mrtg-2.9.17/ext/rmrtgc pandora loadavg.pl -n`
# and the usual stuff follows

Adjust according to your local setup.

And that's it. The first argument to rmrtgc is the hostname to 
which it will try to connect. The port number is hardwired in (for
now) so you may want to change it or check it. The second argument
is the command to execute. At the remote side, rmrtg takes that
string and sticks '/home/mrtg/bin/' (or whatever you've set) in
front of it - thus getting '/home/mrtg/bin/loadavg.pl' - adds on any
arguments you specify, and the output from that command is sent back.

The overall effect is that there is a transparent conduit for MRTG
monitoring data from one machine to another.

$Id: INSTALL,v 1.2 2002/02/10 07:51:33 piers Exp $
