14.6. Configuring and Starting MRTG on Fedora

OK already, enough with the preliminaries. Your SNMP and HTTP daemons are installed and running, and you want to get going with MRTG and start making nice network graphs like everyone else. What do you do now?

First, we'll have MRTG monitor all the up network interfaces on our server.

Run this command to create the initial MRTG configuration file. password is what-ever SNMP community string you set:

	# cfgmaker --output=/etc/mrtg/mrtg.cfg \
	--global "workdir: /var/www/mrtg" -ifref=ip \
	--global 'options[_]: growright,bits' \
	password@localhost

Then, start it manually:

	# mrtg /etc/mrtg/mrtg.cfg
	-----------------------------------------------------------------------
	ERROR: Mrtg will most likely not work properly when the environment
	       variable LANG is set to UTF-8. Please run mrtg in an environment
	       where this is not the case. Try the following command to start:

	       env LANG=C /usr/bin/mrtg /etc/mrtg.cfg
	-----------------------------------------------------------------------

So, do that:

	# env LANG=C mrtg /etc/mrtg/mrtg.cfg

If your default is already LANG=C, then you won't see this message.

Run this command to create the HTML index file:

	# indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg

Now, point a web browser to localhost (http://localhost/mrtg/) and you should see nice graphs tracking all of your up interfaces, like in Figure 14-2 and Figure 14-3 in the previous recipe. This shows that it is working correctly.

Fedora installs a crontab for MRTG in /etc/cron.d/mrtg that updates the graphs every five minutes, so you don't need to take any additional steps to keep it running.

See the Discussion in the previous recipe for explanations of the command options.