


mrtg                                                  NT-GUIDE(1)



NNNNAAAAMMMMEEEE
     nt-guide - The Windows NT Guide to MRTG 2.9.10

SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
     Installing MRTG on an Windows NT box is not quite as click
     and point as some might want it to be. But then again it is
     not all that difficult if you follow the instructions below.

PPPPRRRREEEERRRREEEEQQQQUUUUIIIISSSSIIIITTTTSSSS
     To get MRTG to work on WindowsNT you need the following:

     +o   A copy of Perl for NT from http://www.ActiveState.com
         (it must be version 5.005 or higher).

     +o   The latest version of MRTG from http://ee-
         staff.ethz.ch/~oetiker/webtools/mrtg/pub .  look for
         mrtg-2.9.10.zip or better. The archive does also contain
         a precompiled copy of rateup for 386-NT.

IIIINNNNSSSSTTTTAAAALLLLLLLLAAAATTTTIIIIOOOONNNN
     I suggest you do the following from the machine that will be
     running MRTG, which, in this case is also a web server. All
     examples are for doing things to a LOCAL machine.

     First
         Unzip MRTG to C:\mrtg-2.9.10 on the WindowsNT machine of
         your choice.

     Next
         Install Perl on the same Windows NT machine. You might
         want to make sure that the Perl binary directory is
         listed in your system path.

          C:\Perl\bin;%SystemRoot%\system32;%SystemRoot%;...

         You can manually check this by going to [Control
         Panel]->[System]->[Environment]

     To see if everything is installed properly you can open a
     Command Shell and go into _c_:_\_m_r_t_g_-_2_._9_._9_\_b_i_n. Type:

      perl mrtg

     This should give you a friendly error message complaining
     about the missing mrtg configuration file. Now, you have
     successfully installed mrtg and perl.

CCCCOOOONNNNFFFFIIIIGGGGUUUURRRRIIIINNNNGGGG MMMMRRRRTTTTGGGG
     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:




2001-02-20             Last change: 2.9.10                      1






mrtg                                                  NT-GUIDE(1)



     +o   The IP address or hostname of the and snmp port number,
         (if non standard), of the device you want to monitor.

     +o   If you want to monitor something other than bytes in and
         out, you must also know the SNMPOID of what you want to
         monitor.

     +o   Finally you need to know the read-only SNMP community
         string for your device.  If you don't know it, try
         ppppuuuubbbblllliiiicccc, that is the default.

     For the rest of this document we will be using device
     11110000....11110000....11110000....1111 ( a CISCO Catalyst 5000) with Community string
     ppppuuuubbbblllliiiicccc.  We are interested in monitoring traffic, and the
     CPU Load. Let's begin.

     The first thing we do in setting up mrtg is by making a
     default config file.  Get to a cmd prompt and change to the
     _c_:_\_m_r_t_g_-_2_._9_._9_\_b_i_n directory. Type the following command:

      perl cfgmaker public@10.10.10.1 --global "WorkDir: c:\www\mrtg" --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 _c_f_g_m_a_k_e_r to produce a configuration
     which is based on Ip numbers, or even Interface
     Descriptions. Check the cfgmaker manpage

     If you get an error message complaining about nnnnoooo ssssuuuucccchhhh nnnnaaaammmmeeee
     or nnnnoooo rrrreeeessssppppoooonnnnsssseeee, your community name is probably wrong.

     Now, lets take a look at the mrtg.cfg file that was created.

     In Perl a `#' is a comment, synonymous with `REM' in DOS.

     Add the following to the top of the mrtg.cfg file:

      WorkDir: D:\InetPub\wwwroot\MRTG

     This is where the web pages are created, usually a web root.

      ######################################################################
      # Description: LCP SUWGB
      # Contact: Administrator
      # System Name: LC-Bridge
      # Location: Here
      #.....................................................................

     TargetDevice's IP Address:Interface Number:Community:IP
     Address



2001-02-20             Last change: 2.9.10                      2






mrtg                                                  NT-GUIDE(1)



      Target[10.10.10.1.1]: 1:public@10.10.10.1

     This is the interface speed (Default is 10 megabits; for
     100Mbit devices use 12500000 and so on...)

      MaxBytes[10.10.10.1.1]: 1250000

      Title[10.10.10.1.1]: LC-Bridge (sample.device): ether0

     This section determines how the web page headers will look

      PageTop[10.10.10.1.1]: <H1>Traffic Analysis for ether0</H1>
       <TABLE>
       <TR><TD>System:</TD><TD>LC-Bridge inAndover</TD></TR>
       <TR><TD>Maintainer:</TD><TD>Administrator</TD></TR>
       <TR><TD>Interface:</TD><TD>ether0(1)</TD></TR>
       <TR><TD>IP:</TD><TD>sample.device(10.10.10.1)</TD></TR>
       <TR><TD>Max Speed:</TD>
       <TD>1250.0 kBytes/s (ethernetCsmacd)</TD></TR>
       </TABLE>

       Target[10.10.10.1.2]: 2:public@10.10.10.1
       MaxBytes[10.10.10.1.2]: 1250000
       Title[10.10.10.1.2]: LC-Bridge (): ulink0
       PageTop[10.10.10.1.2]: <H1>Traffic Analysis for ulink0</H1>
        <TABLE>
        <TR><TD>System:</TD><TD>LC-Bridge inAndover</TD></TR>
        <TR><TD>Maintainer:</TD><TD>Administrator</TD></TR>
        <TR><TD>Interface:</TD><TD>ulink0(2)</TD></TR>
        <TR><TD>IP:</TD><TD>()</TD></TR>
        <TR><TD>Max Speed:</TD>
        <TD>1250.0 kBytes/s (ethernetCsmacd)</TD></TR>
        </TABLE>

       #---------------------------------------------------------------

     And that is a very basic mrtg config file. You can run this
     and see your results by going into the _c_:_\_m_r_t_g_-_2_._9_._9_\_b_i_n
     directory and typing:

      perl mrtg mrtg.cfg

     It is normal to get errors for the first two times you run
     this command. The errors will alert you about the fact that
     there have not been any log files in existnace before.

     If you take a look at those web pages they are not real
     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.




2001-02-20             Last change: 2.9.10                      3






mrtg                                                  NT-GUIDE(1)



MMMMAAAAKKKKEEEE MMMMRRRRTTTTGGGG RRRRUUUUNNNN AAAALLLLLLLL TTTTHHHHEEEE TTTTIIIIMMMMEEEE
     Starting mrtg every time you want to run it by hand is not
     going to make you happy I guess.

     There is a special entry into the mrtg configuration file
     you can add so that mrtg will not terminate after it was
     started. Instead it will wait for 5 minutes and then run
     again.

     Add the option

      RunAsDaemon: yes

     to your mrtg.cfg file and start it with:

      start /B perl c:\mrtg-2.9.10\bin\mrtg c:\mrtg-2.9.10\bin\mrtg.cfg

     If you now put this sequence into your startup folder, mrtg
     will start whever you login to your NT box.

     You might also want to try Miroslaw M. Maczkas mrtg NT
     service package. You can find it in
     _c_:_\_m_r_t_g_-_2_._9_._9_\_c_o_n_t_r_i_b_\_n_t_-_s_e_r_v_i_c_e_s it comes with its own
     installation Instructions.

     Or you can have a look at http://www.firedaemon.com/mrtg-
     howto.html which gives away a free tool to start any program
     as a Service.

     If you want to restart mrtg for every run, check out the
     WINDOWS NT ADMINISTRATIVE TOOLSET (aka AINTX) on
     http://maxx.mc.net/~jlh/nttools/html/nttools.htm it contains
     amongst other things a propper cron service for NT.

     A further possibility is the ssssrrrrvvvvaaaannnnyyyy....eeeexxxxeeee program from the NT
     Resource Kit.  It provides means for running just about any
     program as a service.

     Congratulations! You are now monitoring traffic on a device
     of your choice.

EEEEXXXXAAAAMMMMPPPPLLLLEEEE
     Now lets look at a config file to monitor what we wanted to
     on our mythical Cisco Cat 5000 -- utilization on ports 3, 5,
     10, and 24, and the CPU Load, which will show us nonstandard
     mrtg configurations as well as more options..

      WorkDir: D:\InetPub\wwwroot\MRTG







2001-02-20             Last change: 2.9.10                      4






mrtg                                                  NT-GUIDE(1)



      ######################################################################
      # Description: LCP SUWGB
      # Contact: Administrator
      # System Name: LC-Bridge
      # Location: Here
      #.....................................................................

      Target[10.10.10.1.1]: 3:public@10.10.10.1
      MaxBytes[10.10.10.1.1]: 1250000
      Title[10.10.10.1.1]: LC-Bridge (sample-device): ether0
      PageTop[10.10.10.1.1]: <H1>Traffic Analysis for ether0</H1>
       <TABLE>
      <TR><TD>System:</TD><TD>LC-Bridge inAndover</TD></TR>
      <TR><TD>Maintainer:</TD><TD>Administrator</TD></TR>
      <TR><TD>Interface:</TD><TD>ether0(3)</TD></TR>
      <TR><TD>IP:</TD><TD>sample-device(10.10.10.1)</TD></TR>
      <TR><TD>Max Speed:</TD>
      <TD>1250.0 kBytes/s (ethernetCsmacd)</TD></TR>
      </TABLE>

      #---------------------------------------------------------------

      Target[10.10.10.1.2]: 5:public@10.10.10.1
      MaxBytes[10.10.10.1.2]: 1250000
      Title[10.10.10.1.2]: LC-Bridge (): ulink0
      PageTop[10.10.10.1.2]: <H1>Traffic Analysis for ulink0</H1>
       <TABLE>
       <TR><TD>System:</TD><TD>LC-Bridge inAndover</TD></TR>
       <TR><TD>Maintainer:</TD><TD>Administrator</TD></TR>
       <TR><TD>Interface:</TD><TD>ulink0(5)</TD></TR>
       <TR><TD>IP:</TD><TD>()</TD></TR>
       <TR><TD>Max Speed:</TD>
       <TD>1250.0 kBytes/s (ethernetCsmacd)</TD></TR>
       </TABLE>

      #---------------------------------------------------------------

      Target[10.10.10.1.1]: 10:public@10.10.10.1
      MaxBytes[10.10.10.1.1]: 1250000
      Title[10.10.10.1.1]: LC-Bridge (sample-device): ether0
      PageTop[10.10.10.1.1]: <H1>Traffic Analysis for ether0</H1>
       <TABLE>
       <TR><TD>System:</TD><TD>LC-Bridge inAndover</TD></TR>
       <TR><TD>Maintainer:</TD><TD>Administrator</TD></TR>
       <TR><TD>Interface:</TD><TD>ether0(10)</TD></TR>
       <TR><TD>IP:</TD><TD>sample-device(10.10.10.1)</TD></TR>
       <TR><TD>Max Speed:</TD>
       <TD>1250.0 kBytes/s (ethernetCsmacd)</TD></TR>
       </TABLE>

      #---------------------------------------------------------------




2001-02-20             Last change: 2.9.10                      5






mrtg                                                  NT-GUIDE(1)



      Target[10.10.10.1.2]: 24:public@10.10.10.1
      MaxBytes[10.10.10.1.2]: 1250000
      Title[10.10.10.1.2]: LC-Bridge (): ulink0
      PageTop[10.10.10.1.2]: <H1>Traffic Analysis for ulink0</H1>
       <TABLE>
       <TR><TD>System:</TD><TD>LC-Bridge inAndover</TD></TR>
       <TR><TD>Maintainer:</TD><TD>Administrator</TD></TR>
       <TR><TD>Interface:</TD><TD>ulink0(24)</TD></TR>
       <TR><TD>IP:</TD><TD>()</TD></TR>
       <TR><TD>Max Speed:</TD>
       <TD>1250.0 kBytes/s (ethernetCsmacd)</TD></TR>
       </TABLE>

      #---------------------------------------------------------------

      # Router CPU load %
      Target[cpu.1]:1.3.6.1.4.1.9.2.1.58.0&1.3.6.1.4.1.9.2.1.58.0:public@10.10.10.1
      RouterUptime[cpu.1]: public@10.10.10.1
      MaxBytes[cpu.1]: 100
      Title[cpu.1]: CPU LOAD
      PageTop[cpu.1]: <H1>CPU Load %</H1>
      Unscaled[cpu.1]: ymwd
      ShortLegend[cpu.1]: %
      XSize[cpu.1]: 380
      YSize[cpu.1]: 100
      YLegend[cpu.1]: CPU Utilization
      Legend1[cpu.1]: CPU Utilization in % (Load)
      Legend2[cpu.1]: CPU Utilization in % (Load)
      Legend3[cpu.1]:
      Legend4[cpu.1]:
      LegendI[cpu.1]:
      LegendO[cpu.1]: &nbsp;Usage
      Options[cpu.1]: gauge

     This is a nice example of how to monitor any SNMP device if
     you know what OID you want to use. Once again, For an
     explanation of the more advance features of mrtg, please see
     Tobias's documentation.

AAAAUUUUTTTTHHHHOOOORRRRSSSS
     David S. Divins <ddivins@moon.jic.com>, Steve Pierce
     <MRTG@HDL.com>, Tobi Oeitker <oetiker@ee.ethz.ch>













2001-02-20             Last change: 2.9.10                      6



