Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MRTG FOR WINDOWS installation Guide

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

MRTG FOR WINDOWS installation Guide

MRTG (Multi Router Traffic Grapher), generally speaking, is an open source software that monitors the traffic load of network links. It can fetch information from all devices running the SNMP protocol, including servers, routers, switches, etc. In fact, it can not only monitor network devices, but also any other devices that support SNMP protocol can be used as monitoring objects of MRTG, and automatically generate HTML documents containing PNG graphics format and display them to users through HTTP.

Official installation guide: http://mrtg.cs.pu.edu.tw/doc/mrtg-nt-guide.en.html

Prepare the installation environment

In addition to the MRTG installer, several assistive software should be downloaded before installation. The software is all free.

1. Download MRTG

Http://www.mrtg.org

two。 Download ActivePerl

Http://www.activestate.com/Products/Download/Download.plex?id=ActivePerl

3. Download the Windows services installation tools: SERANY.exe and INSTSRV.exe

Http://www.electrasoft.com/srvany/srvany.htm

Install MRTG

After downloading the above software, you can begin to install it. In fact, it's easy to install MRTG on Windows, because MRTG is developed in Perl, so you need to install a runtime environment for Perl first.

1. Install ActivePerl

Extract the ActivePerl package, find the install.bat file in the installation directory, and run it. In the DOS window, the installer will ask some questions, such as the installation path, whether to modify the environment variables, etc., you can all use the default settings, all the way enter on the line. Perl is installed by default in the C:\ Perl directory. After the installation is complete, open the environment variable of Windows to check whether the running file path of Perl has been increased.

two。 Install MRTG

To extract the MRTG package, I am using the MRTG-2.12.2 version. Just move the extracted directory to C:\.

What you need to pay attention to.

(1) install SNMP protocol support for Windows

Usually because SNMP is a recommended shutdown protocol (due to security vulnerabilities), Windows 2003 is not installed by default. But MRTG is to use the SNMP protocol, if there is any way, just install one. In Control Panel-> add / remove programs-> Windows component installation, install the components of SNMP. (open the Windows components Wizard-- > in components, click Administrative and Monitoring tools (but do not select or clear its check box), and then click details.

Select the simple Network Management Protocol check box, and then click OK.)

(2) modify the security settings of SNMP

If Windows is also running on the monitored machine, this part must be set (it must be set in the monitored party, the server where the MRTG is located may not be set), otherwise the message of SNMP will never be received.

Open the Services window and locate the SNMP service, open the right-click menu, and select Properties. Find the Security option page in the open window. There are two settings in the options page, the top half refers to which Community directives the SNMP service accepts, and by default Windows 2003 does not respond to any directives. I usually set it to "public--READ ONLY". You can set a trusted hostname, IP, or IPX name in the lower part.

(3) modify the firewall

If you install a firewall, remember to open UDP 161port, otherwise there will be a lot of problems.

Run MRTG

Well, the installation is finally finished. Now you can run MRTG and see what it really looks like.

Open the DOS window, first enter C:\ mrtg\ bin, and then enter the following command:

Perl cfgmaker public@localhost-global "WorkDir:C:\ Inetpub\ wwwroot\ mrtg"-output mrtg.cfg

This command creates a monitoring profile for MRTG, which monitors localhost, the local machine. You can also use IP addresses instead of localhost, or point to other monitoring hosts. (note: in the above command, there should be a space between WorkDir: and C: drive letter! In addition, the directory C:\ Inetpub\ wwwroot\ mrtg can also be changed to other directories, but because mrtg generates statistical charts and web pages under this working directory, it is generally designated as a directory under a certain site to facilitate viewing statistics directly from the Internet)

Type another command:

Perl mrtg mrtg.cfg

This command creates some HTML and PNG files in the C:\ Inetpub\ wwwroot\ mrtg directory, which are the traffic reports that users usually see.

Make MRTG a service of Windows

SERANY.exe and INSTSRV.exe are the software of the tools that come with Windows. They can install any Windows application as

A service of Windows.

(1). Modify the registry

Create a text file, write the following to the file, and save it as a mrtg.reg file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ MRTG\ Parameters]

"Application" = "c:\ perl\\ bin\\ wperl.exe"

"AppParameters" = "c:\ mrtg\\ bin\\ mrtg--logging=eventlog c:\\ mrtg\\ bin\\ mrtg.cfg"

"AppDirectory" = "c:\\ mrtg\\ bin\"

(2), installation service

Copy SERANY.exe,instsrv.exe to the installation directory of MRTG, and type the following command:

Instsrv MRTG c:\ mrtg\ bin\ srvany.exe

Double-click the mrtg.reg file to register the relevant information in the registry. Run the service named MRTG under Control Panel-> Administrative tools-> Services.

By default, mrtg collects data every 5 minutes (Note: be sure to add RunAsDaemon: yes to the last line of the bin\ mrtg.cfg configuration file)

For cases where you want to use mrtg to monitor multiple devices, an example is as follows:

Cfgmaker-- global "WorkDir: / var/www/html/mrtg"

-- global "Options [_]: growright,bits"

-- ifref=descr

-- ifdesc=alias

Public@router1.place.xyz

Public@router2.place.xyz

-- global "Options [_]: growright"

-- ifref=name

-- ifdesc=descr

Public@switch2.place.xyz

-- ifdesc=name

Public@switch3.place.xyz >; mrtg.cfg

Here instructions are given to monitor four devices: router1.place.xyz, router2.place.xyz, and switch2.place.xyz

And switch3.place.xyz, all devices are monitored by the community name public. And the two routers use descr as the device description information, while the two switches use alias as the device description (the two are different, for example, for cisco routers, the device is described as "Serial0" for descr and "Link to HQ" for aliasl).

Run mrtg

Once the correct configuration file is generated, run the following command:

/ usr/local/mrtg-2/bin/mrtg / etc/mrtg.cfg

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report