MandrakeUser.Org - Your Mandrake-Linux Knowledge Base!


 
 

* DocIndex - Connectivity

MRTG Setup On ML 7.2

(Contributed by Colin Tinker)

Related Resources:

MRTG home page

Revision / Modified: July 31, 2001 / Dec 11, 2000
Author: Colin Tinker

 

You will need to have a working web server and Perl installed to run 'mrtg', the 'Multi Router Traffic Grabber'.

To get the rpm go to any mirror site and you will find the rpm in the contrib directory, it is called 'mrtg-2.9.4-2mdk.i586.rpm' (or higher).

Install with rpm -Uvh mrtg-2.9.4-2mdk.i586.rpm

The install puts an entry to run 'mrtg' in '/etc/crontab'. You can leave this alone and run it from there but I prefer the script below as it can be controlled more easily with service mrtg start | stop | statusrather than having to hash it out in crontab. Create the user 'mrtg' with your favorite tool, I prefer Webmin for this.

Do not forget to remove the entry or rem it out with a hash in the '/etc/crontab' file. Set the permissions on '/var/www/html/mrtg' with the command:

chown -R mrtg:mrtg mrtg /var/www/html/mrtg

Change the directory to /var/www/html and 'su' to 'root'. Run:

cfgmaker --output=mrtg.cfg --subdirs=HOSTNAME public@xxxx.g1gsw.org public@yyyy.g1gsw.org

The --subdirs=HOSTNAME puts each system in its own subdirectory, easier to manage I find. --output will create the 'mrtg.cfg' configuration file. Substitute 'xxxx' and 'yyyy' with the host names of your systems. There can be as many as you want on the command line and public with your community name in snmp.

Next run:

indexmaker --output=xxxx.html --columns=1 --title="xxxx Network Status" mrtg.cfg

This creates the index page for your site, do not call it 'index' as the manual page has an index.html, I used the domain name. That is the output part of the command, --title="xxxxx" is the title on the page.--columns=n sets the number (n) of columns on the page.

The script goes in /etc/init.d and is called 'mrtg'. Set it as executable (chmod 755 /etc/init.d/mrtg).

Next run:

service mrtg start

to start 'mrtg'.

To make it run at every (re)boot, run:

chkconfig --add mrtg

Point your browser at 'http://localhost/mrtg/xxxx.html', 'xxxx' is what you called the index page above.

* section index * top

 
Legal: All texts on this site are covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB (Tom Berger) and Mandrakesoft 1999-2002.