Monitor server traffic with MRTG

Source: Internet
Author: User
Tags mrtg

Reference: http://oss.oetiker.ch/mrtg/doc/mrtg-nt-guide.en.html

Monitored end:
1. Add the SNMP service to the monitored machine as follows:
Start → set → Control Panel → add or delete programs → Add/Windows Components (a) → management and monitoring tools → Simple Network Management Protocol (SNMP ).
Note: During installation, you must enter the Windows system disk.
2. Configure the SNMP Service as follows:
Start → run → services. msc → locate the SNMP service → double-click to open → Add a group of public in the Security tab, and add the control IP below → OK.
Note: If a firewall is installed, open UDP port 161 to the control end.
3. If multiple servers need to be monitored, repeat the preceding steps on each server.

Control end:
1. First download the required files:
1. ActivePerl:
Http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.8.819-MSWin32-x86-267479.msi
2. mrtg.2.15.0
Http://oss.oetiker.ch/mrtg/pub/mrtg-2.15.0.zip
3.srvany.exeand instsrv.exe
Http://www.electrasoft.com/srvany/srvany.exe
Http://www.electrasoft.com/srvany/instsrv.exe

Install activeperlin erver Load balancer to decompress mrtg.2.15.0.zip to C:/mrtg.2.15.0
Start → run → Enter cmd → OK to enter the command mode
Cd c: // mrtg-2.15.0/bin
Perl generator maker public @ controlled IP1 -- Global "workdir: C:/www/MRTG" -- output mrtg1.cfg
Perl generator maker public @ controlled ip2 -- Global "workdir: C:/www/MRTG" -- output mrtg2.cfg
...
Open mrtg1.cfg, mrtg2.cfg... and add a row:
Runasdaemon: Yes
Generate homepage:
Perl indexmaker -- output = C:/www/MRTG/index.htm mrtg. cfg mrtg1.cfg mrtg2.cfg...

Iii. Install services
Paste srvany.exeand instsrv.exe into the C:/mrtg-2.15.0/bin directory
Start → run → Enter cmd → OK to enter the command mode
Cd c: // mrtg-2.15.0/bin
Instsrv.exe mrtg1 C:/mrtg-2.15.0/bin/srvany.exe
Instsrv.exe mrtg2 C:/mrtg-2.15.0/bin/srvany.exe
...
Create the file mrtg. Reg with the following content:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE/system/CurrentControlSet/services/MRTG/parameters]
"Application" = "wperl.exe"
"Appparameters" = "MRTG -- logging = mrtg1.log mrtg1.cfg"
"Appdirectory" = "C: // mrtg-2.15.0 // bin"

[HKEY_LOCAL_MACHINE/system/CurrentControlSet/services/MRTG/parameters]
"Application" = "wperl.exe"
"Appparameters" = "MRTG -- logging = mrtg2.log mrtg2.cfg"
"Appdirectory" = "C: // mrtg-2.15.0 // bin"

...
Double-click Import
Iv. Run
Start → run → services. MSC
Start mrtg1, mrtg2. .. and other services respectively
Go to the C:/www/MRTG directory and check whether the generation is correct.

PS: when installing the service, you cannot generate it correctly. You can view files such as mrtg1.log and find the following information:
18:12:47 -- 18: 12: 47: Warning: rateup (C:/mrtg-2.15.0/bin/rateup C:/www/MRTG/X. x. x. x_196610 1170151967-z u 38115373 34091216 1250000 C #00cc00 # 0000ff #006600 # ff00ff K 1000 I C: /www/MRTG/x.x.x.x_196610-day.png-1250000-1250000 400 100 1 1 0 300 0 4 1 "% Y-% m-% d % H: % m" 0 I C: /www/MRTG/x.x.x.x_196610-week.png-1250000-1250000 400 100 1 1 0 1800 0 4 1 "% Y-% m-% d % H: % m" 0 I C: /www/MRTG/x.x.x.x_196610-month.png-1250000-1250000 400 100 1 1 0 7200 0 4 1 "% Y-% m-% d % H: % m" 0) did not work: bad file descriptor
After one afternoon, I finally found out the cause. When installing the system, I used to file C:/Windows/system32/cmd.exe in addition to the administrators user group for security reasons, all other user permissions are deleted. To solve this problem, add the system read and run permissions.

In addition, in the process of searching for information, we found that the MRTG is not authorized to monitor the traffic, and WMI and SNMP can be used to monitor information such as CPU, memory, and connections, which is very powerful, however, these functions are not available for the time being and will be studied later.

Appendix: links to useful materials
Http://snmpboy.msft.net/
Http://bbs.chinaunix.net/viewthread.php? Tid = 524676 & extra = & page = 1
Http://www.wtcs.org/snmp4tpc/snmp4w2k.htm
Http://www.snmplink.org/News.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.