Updated on 11 Feb 2004

mrtg-2.10.5 on Windows 2000

The Multi Router Traffic Grapher (MRTG) is a tool to monitor the traffic load on network-links. MRTG generates HTML pages containing graphical images which provide a LIVE visual representation of this traffic. Check http://www.ee.ethz.ch/stats/mrtg/ for an example. MRTG is based on Perl and C and works under UNIX and Windows NT. MRTG is being successfully used on many sites around the net.

Download

MRTG mrtg-2.10.5.zip
Active Perl ActivePerl-5.8.2.808-MSWin32-x86.msi

Installation

  1. Install Active Perl (ActivePerl-5.8.2.808-MSWin32-x86.msi)
  2. Unzip MRTG to C:\mrtg on the Windows2000 machine of your choice.
  3. To see if everything is installed properly you can open a Command Shell and go into c:\mrtg\bin. Type:
    perl mrtg
    

Configuring MRTG

Now it is time to walk create a configuration for mrtg.But before we begin you need to know a few things, take an opportunity to gather the following information:

  • The IP address or hostname of the and snmp port number, (if non standard), of the device you want to monitor.
  • If you want to monitor something other than bytes in and out, you must also know the SNMPOID of what you want to monitor.
  • Finally you need to know the read-only SNMP community string for your device. If you don't know it, try public, that is the default.
    1. Make C:\mrtg\bin\makecfg.bat and execute. This will monitor 192.168.0.6 and 192.168.0.9
      Set DIR_BIN=C:\mrtg\bin
      Set DIR_WWW=C:\inetpub\wwwroot\mrtg
      Set PERL=C:\perl\bin\perl.exe
      
      If Not exist %DIR_WWW% (
      	mkdir %DIR_WWW%
      )
      
      %PERL% "%DIR_BIN%\cfgmaker" --ifref=eth@--global "Options[_]: bits,growright" 192.168.0.1 192.168.0.2 --global "WorkDir: %DIR_WWW%"  --community=public --output mrtg.cfg
      

      This creates an initial MRTG config file for you. Note that in this file all interfaces of your router will be stored by number. Unfortunately these numbers are likely to change when ever you reconfigure your router. So in order to work around this you can get cfgmaker to produce a configuration which is based on Ip numbers, or even Interface Descriptions.

      If you get an error message complaining about no such name or no response, your community name is probably wrong.

    2. Make C:\mrtg\bin\mrtgcron.bat and execute
      Set DIR_BIN="C:\mrtg\bin"
      Set DIR_WORK="C:\inetpub\wwwroot\mrtg"
      Set PERL=start /low C:\perl\bin\perl.exe
      
      REM Make Index file
      %PERL% %DIR_BIN%\indexmaker --columns=1 mrtg.cfg > %DIR_WORK%\default.htm
      
      REM Analyze
      %PERL% %DIR_BIN%\mrtg mrtg.cfg
      

      If you take a look at those web pages they are not really exciting, yet. You need to have the mrtg files run every five minutes to produce the desired results. Just run it again after a few minutes. You should now be able to see the first lines in your graphs.

    Make MRTG run all the time

    If you want to start MRTG as a service, you can use firedaemon which can start any program as a service. Download Fire Daemon.
    1. Insert lines at the C:\mrtg\bin\mrtg.cfg
      RunAsDaemon: yes
      Interval: 5
      
    2. Download and Install Fire Daemon
    3. Run the "FireDaemon Service Manager", and click [Create a new service definition] button.

    4. Type as below,

    5. Click [OK].

    6. Finish


    Back - Support
    Google
    Web www.grape-info.com