14.5. Configuring and Starting MRTG on Debian
Problem
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?
Solution
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 whatever SNMP community
string you set:
# cfgmaker --output=/etc/mrtg.cfg \
--global "workdir: /var/www/mrtg" -ifref=ip \
--global 'options[_]: growright,bits' \
password@localhostThen, start it manually:
# mrtg /etc/mrtg.conf ----------------------------------------------------------------------- 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.cfgIf your default is already LANG=C, then you won't see that message. If
you get "Rateup WARNING" error messages, repeat the command until they
go away. This usually takes three tries.
Run this command to create the HTML index file:
# indexmaker --output=/var/www/mrtg/index.html /etc/mrtg.cfgNow, 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 ...
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