Blame doc/mrtg-nt-guide.txt

Packit 667938
MRTG-NT-GUIDE(1)                     mrtg                     MRTG-NT-GUIDE(1)
Packit 667938
Packit 667938
Packit 667938
Packit 667938
N?NA?AM?ME?E
Packit 667938
       mrtg-nt-guide - The MRTG 2.17.7 Windows Installation Guide
Packit 667938
Packit 667938
S?SY?YN?NO?OP?PS?SI?IS?S
Packit 667938
       Installing MRTG on a Windows box is not quite as "click and point" as
Packit 667938
       some might want it to be. But then again, it is not all that difficult
Packit 667938
       if you follow the instructions below.
Packit 667938
Packit 667938
P?PR?RE?ER?RE?EQ?QU?UI?IS?SI?IT?TE?ES?S
Packit 667938
       To get MRTG to work on Windows you need the following:
Packit 667938
Packit 667938
       +?o   A current copy of Perl.  For Example ActivePerl 5.8.8 from
Packit 667938
           ActiveState http://www.activestate.com/store/activeperl/download/
Packit 667938
Packit 667938
       +?o   The latest version of MRTG from http://oss.oetiker.ch/mrtg/pub.
Packit 667938
           Look for mrtg-2.17.7.zip or better. The archive also contains a
Packit 667938
           precompiled copy of rateup.exe for Win32.
Packit 667938
Packit 667938
I?IN?NS?ST?TA?AL?LL?LI?IN?NG?G
Packit 667938
       I suggest you do the following from the machine that will be running
Packit 667938
       MRTG, which, in this case, is also a web server. All examples are for
Packit 667938
       doing things to a LOCAL machine.
Packit 667938
Packit 667938
       First
Packit 667938
           Unzip MRTG to C:\mrtg-2.17.7 on the Windows machine of your choice.
Packit 667938
Packit 667938
       Next
Packit 667938
           Install Perl on the same Windows machine. You might want to make
Packit 667938
           sure that the Perl binary directory is listed in your system path.
Packit 667938
Packit 667938
            C:\Perl\bin;%SystemRoot%\system32;%SystemRoot%;...
Packit 667938
Packit 667938
           You can manually check this by going to [Control
Packit 667938
           Panel]->[System]->[Environment]
Packit 667938
Packit 667938
       To see if everything is installed properly you can open a Command Shell
Packit 667938
       and go into _?c_?:_?\_?m_?r_?t_?g_?-_?2_?._?1_?7_?._?7_?\_?b_?i_?n. Type:
Packit 667938
Packit 667938
        perl mrtg
Packit 667938
Packit 667938
       This should give you a friendly error message complaining about the
Packit 667938
       missing MRTG configuration file. Now, you have successfully installed
Packit 667938
       MRTG and Perl.
Packit 667938
Packit 667938
C?CO?ON?NF?FI?IG?GU?UR?RI?IN?NG?G M?MR?RT?TG?G
Packit 667938
       Now it is time to create a configuration for MRTG. But before we begin
Packit 667938
       you need to know a few things. Take an opportunity to gather the
Packit 667938
       following information:
Packit 667938
Packit 667938
       +?o   The IP address or hostname and the SNMP port number, (if non
Packit 667938
           standard), of the device you want to monitor.
Packit 667938
Packit 667938
       +?o   If you want to monitor something other than bytes in and out, you
Packit 667938
           must also know the SNMPOID of what you want to monitor.
Packit 667938
Packit 667938
       +?o   Finally you need to know the read-only SNMP community string for
Packit 667938
           your device. If you don't know it, try p?pu?ub?bl?li?ic?c, that is the default.
Packit 667938
Packit 667938
       For the rest of this document we will be using device 1?10?0.?.1?10?0.?.1?10?0.?.1?1 ( a
Packit 667938
       CISCO Catalyst 5000) with Community string p?pu?ub?bl?li?ic?c. We are interested in
Packit 667938
       monitoring traffic, and the CPU load. Let's begin.
Packit 667938
Packit 667938
       The first thing we do in setting up MRTG is making a default config
Packit 667938
       file.  Get to a cmd prompt and change to the _?c_?:_?\_?m_?r_?t_?g_?-_?2_?._?1_?7_?._?7_?\_?b_?i_?n
Packit 667938
       directory. Type the following command:
Packit 667938
Packit 667938
        perl cfgmaker public@10.10.10.1 --global "WorkDir: c:\www\mrtg" --output mrtg.cfg
Packit 667938
Packit 667938
       This creates an initial MRTG config file for you. Note that in this
Packit 667938
       file all interfaces of your router will be stored by number.
Packit 667938
       Unfortunately, these numbers are likely to change whenever you
Packit 667938
       reconfigure your router. In order to work around this you can get
Packit 667938
       _?c_?f_?g_?m_?a_?k_?e_?r to produce a configuration which is based on Ip numbers, or
Packit 667938
       even Interface Descriptions. Check cfgmaker
Packit 667938
Packit 667938
       If you get an error message complaining about n?no?o s?su?uc?ch?h n?na?am?me?e or n?no?o
Packit 667938
       r?re?es?sp?po?on?ns?se?e, your community name is probably wrong.
Packit 667938
Packit 667938
       Now, let's take a look at the mrtg.cfg file that was created.
Packit 667938
Packit 667938
       In Perl, a "#" is a comment, synonymous with "REM" in DOS.
Packit 667938
Packit 667938
       Add the following to the top of the mrtg.cfg file:
Packit 667938
Packit 667938
        WorkDir: c:\www\mrtg
Packit 667938
Packit 667938
       This is where the web pages are created, usually a web root.
Packit 667938
Packit 667938
        ######################################################################
Packit 667938
        # Description: LCP SUWGB
Packit 667938
        # Contact: Administrator
Packit 667938
        # System Name: LC-Bridge
Packit 667938
        # Location: Here
Packit 667938
        #.....................................................................
Packit 667938
Packit 667938
       TargetDevice's IP Address:Interface Number:Community:IP Address
Packit 667938
Packit 667938
        Target[10.10.10.1.1]: 1:public@10.10.10.1
Packit 667938
Packit 667938
       This is the interface speed (Default is 10 megabits; for 100Mbit
Packit 667938
       devices use 12500000 and so on...)
Packit 667938
Packit 667938
        MaxBytes[10.10.10.1.1]: 1250000
Packit 667938
Packit 667938
        Title[10.10.10.1.1]: LC-Bridge (sample.device): ether0
Packit 667938
Packit 667938
       This section determines how the web page headers will look
Packit 667938
Packit 667938
        PageTop[10.10.10.1.1]: 

Traffic Analysis for ether0

Packit 667938
         
Packit 667938
         System:LC-Bridge inAndover
Packit 667938
         Maintainer:Administrator
Packit 667938
         Interface:ether0(1)
Packit 667938
         IP:sample.device(10.10.10.1)
Packit 667938
         Max Speed:
Packit 667938
         1250.0 kBytes/s (ethernetCsmacd)
Packit 667938
         
Packit 667938
Packit 667938
         Target[10.10.10.1.2]: 2:public@10.10.10.1
Packit 667938
         MaxBytes[10.10.10.1.2]: 1250000
Packit 667938
         Title[10.10.10.1.2]: LC-Bridge (): ulink0
Packit 667938
         PageTop[10.10.10.1.2]: 

Traffic Analysis for ulink0

Packit 667938
          
Packit 667938
          System:LC-Bridge inAndover
Packit 667938
          Maintainer:Administrator
Packit 667938
          Interface:ulink0(2)
Packit 667938
          IP:()
Packit 667938
          Max Speed:
Packit 667938
          1250.0 kBytes/s (ethernetCsmacd)
Packit 667938
          
Packit 667938
Packit 667938
         #---------------------------------------------------------------
Packit 667938
Packit 667938
       And that's a very basic MRTG config file. You can run this and see your
Packit 667938
       results by going into the _?c_?:_?\_?m_?r_?t_?g_?-_?2_?._?1_?7_?._?7_?\_?b_?i_?n directory and typing:
Packit 667938
Packit 667938
        perl mrtg mrtg.cfg
Packit 667938
Packit 667938
       It is normal to get errors for the first two times you run this
Packit 667938
       command. The errors will alert you about the fact that there have not
Packit 667938
       been any log files in existence before.
Packit 667938
Packit 667938
       If you take a look at those web pages they are not very exciting (yet).
Packit 667938
       You need to have the MRTG files run every five minutes to produce the
Packit 667938
       desired results.  Just run it again after a few minutes. You should now
Packit 667938
       be able to see the first lines in your graphs.
Packit 667938
Packit 667938
M?MA?AK?KE?E M?MR?RT?TG?G R?RU?UN?N A?AL?LL?L T?TH?HE?E T?TI?IM?ME?E
Packit 667938
       Starting MRTG by hand every time you want to run it is not going to
Packit 667938
       make you happy I guess.
Packit 667938
Packit 667938
       There is a special option you can set in the MRTG configuration file so
Packit 667938
       so that MRTG will not terminate after it was started. Instead it will
Packit 667938
       wait for 5 minutes and then run again.
Packit 667938
Packit 667938
       Add the option
Packit 667938
Packit 667938
        RunAsDaemon: yes
Packit 667938
Packit 667938
       to your mrtg.cfg file and start it with:
Packit 667938
Packit 667938
        start /Dc:\mrtg-2.17.7\bin wperl mrtg --logging=eventlog mrtg.cfg
Packit 667938
Packit 667938
       If you use w?wp?pe?er?rl?l instead of p?pe?er?rl?l, no console window will show. MRTG is
Packit 667938
       now running in the background. If it runs into problems it will tell
Packit 667938
       you so over the EventLog. To stop MRTG, open the Task Manager and
Packit 667938
       terminate the w?wp?pe?er?rl?l.?.e?ex?xe?e process. If mrtg has anything to tell you these
Packit 667938
       messages can be found in the event log.
Packit 667938
Packit 667938
       If you put a shortcut with
Packit 667938
Packit 667938
        Target:    wperl mrtg --logging=eventlog mrtg.cfg
Packit 667938
        Start in:  c:\mrtg-2.17.7\bin
Packit 667938
Packit 667938
       into your start-up folder, MRTG will now start whenever you login to
Packit 667938
       your NT box.
Packit 667938
Packit 667938
       If you do not want to log into your box just to start MRTG. Have a look
Packit 667938
       at http://www.firedaemon.com/mrtg-howto.html which describes a free
Packit 667938
       tool to start any program as a Service. The pages gives specific
Packit 667938
       instructions for MRTG users.
Packit 667938
Packit 667938
H?HO?OW?W T?TO?O S?SE?ET?TU?UP?P M?MR?RT?TG?G A?AS?S A?A W?WI?IN?ND?DO?OW?WS?S S?SE?ER?RV?VI?IC?CE?E
Packit 667938
   A?Ad?dd?di?it?ti?io?on?na?al?l P?Pr?re?er?re?eq?qu?ui?is?si?it?te?es?s
Packit 667938
       +?o   MRTG must be installed and fully configured on the target system.
Packit 667938
           In the following exercise the assumption is that MRTG is installed
Packit 667938
           under c:\mrtg\ and all the sample files use this location.
Packit 667938
Packit 667938
       +?o   Microsoft Tools S?SR?RV?VA?AN?NY?Y.?.e?ex?xe?e (Applications as Services Utility) and
Packit 667938
           I?IN?NS?ST?TS?SR?RV?V.?.e?ex?xe?e (Service Installer) - Those files can be downloaded
Packit 667938
           from Microsoft as a part of Windows 2000 Resource Kit at
Packit 667938
           <http://www.microsoft.com/windows2000/techinfo/reskit/tools/default.asp>.
Packit 667938
           They are also available from other locations such as
Packit 667938
           <http://www.electrasoft.com/srvany/srvany.htm>,
Packit 667938
           <http://www.iopus.com/guides/srvany.htm>, etc.  Detailed
Packit 667938
           instructions on how to use this package are available at
Packit 667938
           <http://support.microsoft.com/kb/q137890/>.  In order to follow the
Packit 667938
           steps in this HOW-TO you M?MU?US?ST?T obtain both executables.
Packit 667938
Packit 667938
       +?o   You must have administrative rights on the target system.
Packit 667938
Packit 667938
   P?Pr?re?ep?pa?ar?ra?at?ti?io?on?n
Packit 667938
       Please complete the following steps before starting the installation:
Packit 667938
Packit 667938
       +?o   Copy s?sr?rv?va?an?ny?y.?.e?ex?xe?e and i?in?ns?st?ts?sr?rv?v.?.e?ex?xe?e to c:\mrtg-2.17.7\bin\ (your MRTG
Packit 667938
           bin directory).
Packit 667938
Packit 667938
       +?o   Create a file called m?mr?rt?tg?g.?.r?re?eg?g anywhere on your system and paste the
Packit 667938
           following content into it:
Packit 667938
Packit 667938
            Windows Registry Editor Version 5.00
Packit 667938
Packit 667938
            [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MRTG\Parameters]
Packit 667938
            "Application"="c:\\perl\\bin\\wperl.exe"
Packit 667938
            "AppParameters"="c:\\mrtg-2.17.7\\bin\\mrtg --logging=eventlog c:\\mrtg-2.17.7\\bin\\mrtg.cfg"
Packit 667938
            "AppDirectory"="c:\\mrtg-2.17.7\\bin\\"
Packit 667938
Packit 667938
   S?Se?er?rv?vi?ic?ce?e I?In?ns?st?ta?al?ll?la?at?ti?io?on?n
Packit 667938
       Once again, assuming that MRTG is already fully installed and
Packit 667938
       configured on the target system under c:\mrtg\ the following steps are
Packit 667938
       necessary to setup MRTG as a service.
Packit 667938
Packit 667938
       Using the command prompt go into the temporary directory where you
Packit 667938
       unzipped the package.  When there type the following command to create
Packit 667938
       a service named "MRTG" in the Windows Services management console:
Packit 667938
Packit 667938
        instsrv MRTG c:\mrtg\bin\srvany.exe
Packit 667938
Packit 667938
       Now you need to create the A?Ap?pp?p*?* entries required for the new service.
Packit 667938
       You can do this by either right-clicking on the mrtg.reg file and
Packit 667938
       selecting 'merge' or by running the following command:
Packit 667938
Packit 667938
        regedit /s mrtg.reg
Packit 667938
Packit 667938
       After setting up the registry entry it is time to point it to your MRTG
Packit 667938
       installation.  If you have installed MRTG under _?c_?:_?\_?m_?r_?t_?g_?\, you can skip
Packit 667938
       this step.  Open your registry editor (Start -> Run -> regedt32), and
Packit 667938
       locate the [?[H?HK?KE?EY?Y_?_L?LO?OC?CA?AL?L_?_M?MA?AC?CH?HI?IN?NE?E\?\S?SY?YS?ST?TE?EM?M\?\C?Cu?ur?rr?re?en?nt?tC?Co?on?nt?tr?ro?ol?lS?Se?et?t\?\S?Se?er?rv?vi?ic?ce?es?s\?\M?MR?RT?TG?G]?]
Packit 667938
       key.  Make sure that the I?Im?ma?ag?ge?eP?Pa?at?th?h variable is correctly pointing to
Packit 667938
       s?sr?rv?va?an?ny?y.?.e?ex?xe?e located in your MRTG bin directory (for example
Packit 667938
       c:\mrtg\bin\srvany.exe).  Next you have to expand the MRTG tree, and go
Packit 667938
       to the
Packit 667938
       [?[H?HK?KE?EY?Y_?_L?LO?OC?CA?AL?L_?_M?MA?AC?CH?HI?IN?NE?E\?\S?SY?YS?ST?TE?EM?M\?\C?Cu?ur?rr?re?en?nt?tC?Co?on?nt?tr?ro?ol?lS?Se?et?t\?\S?Se?er?rv?vi?ic?ce?es?s\?\M?MR?RT?TG?G\?\P?Pa?ar?ra?am?me?et?te?er?rs?s]?]
Packit 667938
       key.  Under Parameters make sure that all the  A?Ap?pp?pl?li?ic?ca?at?ti?io?on?n variables
Packit 667938
       are setup properly.
Packit 667938
Packit 667938
       At this point you are ready to run the service.  The only thing left to
Packit 667938
       do is to start the MRTG service in the Services management console.
Packit 667938
       After you do this, you should see two new processes running on your
Packit 667938
       system: srvany.exe and wperl.exe.  Make sure to stop any previously
Packit 667938
       running MRTG processes to avoid conflict.
Packit 667938
Packit 667938
       Note that it is imperative to set the R?Ru?un?nA?As?sD?Da?ae?em?mo?on?n:?: y?ye?es?s option or the
Packit 667938
       service will stop after just one single run!
Packit 667938
Packit 667938
E?EX?XA?AM?MP?PL?LE?E
Packit 667938
       Now lets look at a config file to monitor what we wanted to on our
Packit 667938
       mythical Cisco Cat 5000 -- utilization on ports 3, 5, 10, and 24, and
Packit 667938
       the CPU Load, which will show us nonstandard mrtg configurations as
Packit 667938
       well as more options..
Packit 667938
Packit 667938
        WorkDir: c:\www\mrtg
Packit 667938
        RunAsDaemon: yes
Packit 667938
Packit 667938
        ######################################################################
Packit 667938
        # Description: LCP SUWGB
Packit 667938
        # Contact: Administrator
Packit 667938
        # System Name: LC-Bridge
Packit 667938
        # Location: Here
Packit 667938
        #.....................................................................
Packit 667938
Packit 667938
        Target[10.10.10.1.1]: 3:public@10.10.10.1
Packit 667938
        MaxBytes[10.10.10.1.1]: 1250000
Packit 667938
        Title[10.10.10.1.1]: LC-Bridge (sample-device): ether0
Packit 667938
        PageTop[10.10.10.1.1]: 

Traffic Analysis for ether0

Packit 667938
         
Packit 667938
        System:LC-Bridge inAndover
Packit 667938
        Maintainer:Administrator
Packit 667938
        Interface:ether0(3)
Packit 667938
        IP:sample-device(10.10.10.1)
Packit 667938
        Max Speed:
Packit 667938
        1250.0 kBytes/s (ethernetCsmacd)
Packit 667938
        
Packit 667938
Packit 667938
        #---------------------------------------------------------------
Packit 667938
Packit 667938
        Target[10.10.10.1.2]: 5:public@10.10.10.1
Packit 667938
        MaxBytes[10.10.10.1.2]: 1250000
Packit 667938
        Title[10.10.10.1.2]: LC-Bridge (): ulink0
Packit 667938
        PageTop[10.10.10.1.2]: 

Traffic Analysis for ulink0

Packit 667938
         
Packit 667938
         System:LC-Bridge inAndover
Packit 667938
         Maintainer:Administrator
Packit 667938
         Interface:ulink0(5)
Packit 667938
         IP:()
Packit 667938
         Max Speed:
Packit 667938
         1250.0 kBytes/s (ethernetCsmacd)
Packit 667938
         
Packit 667938
Packit 667938
        #---------------------------------------------------------------
Packit 667938
Packit 667938
        Target[10.10.10.1.1]: 10:public@10.10.10.1
Packit 667938
        MaxBytes[10.10.10.1.1]: 1250000
Packit 667938
        Title[10.10.10.1.1]: LC-Bridge (sample-device): ether0
Packit 667938
        PageTop[10.10.10.1.1]: 

Traffic Analysis for ether0

Packit 667938
         
Packit 667938
         System:LC-Bridge inAndover
Packit 667938
         Maintainer:Administrator
Packit 667938
         Interface:ether0(10)
Packit 667938
         IP:sample-device(10.10.10.1)
Packit 667938
         Max Speed:
Packit 667938
         1250.0 kBytes/s (ethernetCsmacd)
Packit 667938
         
Packit 667938
Packit 667938
        #---------------------------------------------------------------
Packit 667938
Packit 667938
        Target[10.10.10.1.2]: 24:public@10.10.10.1
Packit 667938
        MaxBytes[10.10.10.1.2]: 1250000
Packit 667938
        Title[10.10.10.1.2]: LC-Bridge (): ulink0
Packit 667938
        PageTop[10.10.10.1.2]: 

Traffic Analysis for ulink0

Packit 667938
         
Packit 667938
         System:LC-Bridge inAndover
Packit 667938
         Maintainer:Administrator
Packit 667938
         Interface:ulink0(24)
Packit 667938
         IP:()
Packit 667938
         Max Speed:
Packit 667938
         1250.0 kBytes/s (ethernetCsmacd)
Packit 667938
         
Packit 667938
Packit 667938
        #---------------------------------------------------------------
Packit 667938
Packit 667938
        # Router CPU load %
Packit 667938
        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
Packit 667938
        RouterUptime[cpu.1]: public@10.10.10.1
Packit 667938
        MaxBytes[cpu.1]: 100
Packit 667938
        Title[cpu.1]: CPU LOAD
Packit 667938
        PageTop[cpu.1]: 

CPU Load %

Packit 667938
        Unscaled[cpu.1]: ymwd
Packit 667938
        ShortLegend[cpu.1]: %
Packit 667938
        XSize[cpu.1]: 380
Packit 667938
        YSize[cpu.1]: 100
Packit 667938
        YLegend[cpu.1]: CPU Utilization
Packit 667938
        Legend1[cpu.1]: CPU Utilization in % (Load)
Packit 667938
        Legend2[cpu.1]: CPU Utilization in % (Load)
Packit 667938
        Legend3[cpu.1]:
Packit 667938
        Legend4[cpu.1]:
Packit 667938
        LegendI[cpu.1]:
Packit 667938
        LegendO[cpu.1]:  Usage
Packit 667938
        Options[cpu.1]: gauge
Packit 667938
Packit 667938
       This is a nice example of how to monitor any SNMP device if you know
Packit 667938
       what OID you want to use. Once again, for an explanation of the more
Packit 667938
       advance features of mrtg, please see the rest of the documentation.
Packit 667938
Packit 667938
A?AU?UT?TH?HO?OR?RS?S
Packit 667938
       Tobi Oetiker <tobi@oetiker.ch>, David S. Divins <ddivins@moon.jic.com>,
Packit 667938
       Steve Pierce <MRTG@HDL.com>, Artyom Adjemov <one.bofh@gmail.com>, Ilja
Packit 667938
       Ivanov <ivanov@bseu.by> Karel Fajkus <http://fajkus.cz/>
Packit 667938
Packit 667938
Packit 667938
Packit 667938
2.17.7                            2018-07-13                  MRTG-NT-GUIDE(1)