14.1. Installing MRTG
Problem
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?
Solution
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 lighttpdOn Fedora, install it with this command:
# yum install net-snmp-utils net-snmp mrtg lighttpdAnd that's all there is to it. See the next recipes to get up and running.
Discussion
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.
See Also
Net-SNMP: http://net-snmp.sourceforge.net/ ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access