Vous êtes sur la page 1sur 12

INSTALLING MRTG

Before you can install MRTG, you need to download and install Perl first.
Download MRTG to your desktop.
You also need WinZip (or another unzip utility).

RUNNING CFGMAKER
CFGMAKER is used to create a configuration text file for MRTG Data Collection.
It is ran from a DOS Prompt. Before running CFGMAKER, download an install MRTG and Perl.
Begin by opening a DOS Window by typing command in the Run box. Choose OK.

Navigate to the mrtg\bin directory.

This is the fun part! At this point, you must know the community string and IP address for the
equipment you want to monitor. If you don't know, you most likely don't have any business
monitoring it! In this document, I will use a Windows NT Server. It would work exactly the same for
a router, bridge, or switch. The only difference would be the output file might include several
interfaces (or ports) instead of just one. We will use the community string of public and an IP
of 10.1.1.1. Substitute yours as appropriate. Also, we will name the cfg file server.cfg.
Use a name that makes sense to you and your environment.
Type the following syntax on one line as follows. (DOS may automatically wrap the text which is
acceptable.)

perl cfgmaker public@10.1.1.1 --global "WorkDir: f:\mrtghtml" -output server.cfg


Hit Enter when finished. If you used the correct information, your output should look similar to the
output below.

You have now created your first cfg file. For more config options also check Indexmaker. We can
now move forward and start collecting data. Read further and learn how to start MRTG.

RUNNING MRTG
You are now ready to collect data with MRTG.
At the command prompt, type
perl mrtg server.cfg

substituting the name of your cfg file as needed.

You have now collected your first data. Wait about 5 minutes and run the same command
again.
Navigate to the mrtghtml directory created earlier and open the web page. It should be defined as
the device IP and interface number. If you did a something with multiple active interfaces, you will
have many web pages.
Double click to open the web page in Internet Explorer (or your default browser).

Your web page will look close to mine. CLICK HERE. Notice the Daily Graph has the start of a
graph on the left edge. Also, there is data directly below the graph which represent the traffic
levels. If you scroll down to the bottom, you will find some broken picture links.
Here is how to fix them. Navigate to the \mrtg\images directory. Select all images and copy.

Navigate to the \mrtghtml directory and paste. The problem is now fixed. Refresh the web page
in the browser to see the corrected image links.

COLLECTING DATA 24 X 7 X 365


You could collect data sitting around all day and run MRTG manually from a command prompt.
However, I bet you have better things to do with your time. The simplest way to run MRTG is to
run it as a daemon.
Navigate to the \mrtg\bin directory and find your cfg file. This example has used server.cfg. Open
the file with Notepad.

Your cfg file will look similar to this.CLICK HERE.Near the top of the file, type the following
syntax:
RunAsDaemon: Yes
Interval: 5
This will cause MRTG to run every 5 minutes.

Return to the DOS window and run MRTG again.

MRTG is now collecting data every 5 minutes. You can minimize the DOS window to your task bar.
Now you have completely finished installing MRTG.
Closing the window will cause MRTG to die!
If you accidentally closed your MRTG window, open a new DOS window and restart MRTG.
Here is what MRTG can be like after running for months! CLICK HERE
If you need to track multiple targets, MRTG Indexmaker is your next choice

MRTG Indexmaker for Dummies


You have created a working configuration file for MRTG (see CFGMAKER) and you have multiple
targets (or interfaces). The problem is viewing each target one by one. If only there was a way to
have a single webpage for all the targets.
Indexmaker to the rescue.
Open a command prompt

Navigate to the MRTG Directory \mrtg\bin

Type in the following command:

perl indexmaker --output intel510t.htm intel510t.cfg


"--output intel510t.htm" is the name of the webpage output file. Be sure and use the "htm"
extension.

"intel510t.cfg" is the name of the configuration file you want to use in making an index of
targets.

This will generate a html webpage. You need to cut and paste it into the location of the other html
webpages from the configuration files.

The index page will look like the sample below. (Please note the screen shot is cut off on the right
hand side.)

Now you can fully enjoy the benefits of MRTG Multi Router Traffic Grapher !

Vous aimerez peut-être aussi