14.1. Installing MRTG

You're all ready to get MRTG up and running. What's the best way to install it— from sources, or with your nice easy dependency-resolving installers like Aptitude and Yum?

There isn't much to be gained from a source install, other than control over file locations and build options, so using the easy way is perfectly OK. You need snmp, an HTTP server, and MTRG. On Debian, install it this way:

	# aptitude install snmp snmpd mrtg lighttpd

On Fedora, install it with this command:

	# yum install net-snmp-utils net-snmp mrtg lighttpd

And that's all there is to it. See the next recipes to get up and running.

Even in this modern era of sophisticated dependency-resolving package managers like Aptitude and Yum, we are still at the mercy of our distribution maintainers for keeping binary packages up-to-date, and built with useful options. So sometimes a source build is the better option, even though it means more difficult updates and patching. Fortunately, MRTG is popular and well-maintained on most Linux distributions.

The Debian and Fedora packages are based on net-snmp, which contains an SNMP agent, command-line management tools, and a Management Information Browser (MIB).

MRTG depends on SNMP and requires an HTTP server. I like Lighttpd because it is a nice, lightweight HTTP server that is perfect for chores like this, when you don't need all the bells and whistles of Apache. Of course, you may use any HTTP server you like.