14.6. Configuring and Starting MRTG on Fedora
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 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@localhostThen, 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.cfgIf 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.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 and Figure 14-3 in the previous recipe. This shows that it is working correctly.
Discussion ...
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