Use MRTG on CentOS to monitor network device traffic

Source: Internet
Author: User
Tags mrtg smokeping

MRTG is an open source graphical tool for monitoring network traffic load (OETIKER + partner ag in Germany provides one of the open source projects, http://oss.oetiker.ch/mrtg/), through the snmp protocol to obtain the traffic information of the device, the HTML document of the traffic load in PNG format is displayed to the user in WEB mode, and the traffic load (such as) is displayed in a very intuitive way ).


It is very simple and convenient to directly use the YUM in the system to install the server on the X86 architecture. If SRC is used, you need to understand the support needed, such as PERL, GD, LIBPNG, and ZLIB.

The author describes how to use YUM to load the installation package through his own experiments:

Install MRTG


Command

Yum-y install mrtg net-snmp *


Because my web page is published on Apache, you need to install it without the service.


After the MRTG component is installed, it will be created:

A simple configuration file (/etc/mrtg. cfg ),

Crontab (/etc/cron. d/mrtg ),

And the Apache configuration file (/etc/httpd/conf. d/mrtg. conf ).


Next, edit the mrtg. cfg file. There are two methods:

1. Just delete comments and modify them to point to the device you want to monitor. You need to have a good understanding of the MIB or OID information. If possible, you can add it later.

2. It is also a simple method. You only need to use the generator maker to enable MRTG to automatically create a mrtg. cfg (configuration file ). The method is as follows:

Use consumer maker


Command

Registrant maker public@192.168.0.1>/etc/mrtg. conf

Public is known for the public reading of SNMP on the IP address 192.168.0.1 device. Of course, you can also send the MPs queue to another file prepared in advance, so that the file can be modified and then sent to CP.


Workpath is missing in the automatically generated mrtg. conf file. You need to modify it according to the working directory of MRTG in APACHE.


Since the crontab file is complete during installation, no modification is required without special requirements. If you are as anxious as you are to see the results, it is the traffic monitoring chart at the top of this article. You can perform this operation once after completing all the settings.

Debugging


Command

LANG = C LC_ALL = C/usr/bin/mrtg/etc/mrtg. cfg -- lock-file/var/lock/mrtg/mrtg_l -- confcache-file/var/lib/mrtg. OK


Since MRTG is released through APACHE, You need to modify the configuration file (/etc/httpd/conf. d/mrtg. conf) for APACHE based on the actual situation ). In Apache settings, MRTG only defaults to localhost to view the URL on the WEB. If you need to access this URL on another machine (I can access all machines here), you need to modify the Apache configuration file of MRTG and reboot Apache.

Modify Apache settings of MRTG


Command

Vi/etc/httpd/conf. d/mrtg. conf


Alias/mrtg/var/www/mrtg

<Location/mrtg>

Order deny, allow

# Deny from all

# Allow from 127.0.0.1

# Allow from: 1

Allow from all

# Allow from .example.com

</Location>

Restart the Apache service


Command

Service httpd restart


The default working directory on the APACHE web page (A mrtgdirectory is stored under/var/www folder, and the index.html file does not exist. You can use Indexmaker in the mrtg component to create it (Indexmaker instructions help see http://mrtg.cs.pu.edu.tw/doc/indexmaker.en.html ). You can add the following command to crontab, or execute the command after modifying mrtg. cfg each time.

Create index page


Command

Indexmaker -- output =/var/www/mrtg/index.html/etc/mrtg. cfg


Now some of them have been completed. You can open http: // your service URL/mrtg in a browser to view the chart.

Important: Except MRTG, OETIKER + partner ag open-source project (Tobi Oetiker, record) there are also RDtool, SmokePing, RemOcular, Extopus, SpreadButler, DbToRia, OP Tools, and op sepp.
  • RDtool-The Round Robin Database Tool

    All you need for time series data storage and graphing. Write your own custom network or application monitoring script in minutes or use one of the specified pre-made solutions based on RRDtool.


  • SmokePing-The Deluxe Latency Monitor
    Probe for network and application latency. Identify hot spots, see trends developing, send alarms for critical conditions.

  • RemOcular-Your Eyes in the Cloud
    RemOcular provides a AJAX web interface to Unix command line tools like traceroute, top, mpstat ,.

  • Extopus-The Monitoring Aggregator
    Extopus is an aggregating frontend to monitoring systems. Its plug-in architecture provides an easy route to integrating output from a wide array of monitoring systems into a single instance of Extopus.

  • SpreadButler-The Spreadsheet Publisher
    Spreadbutler is an Ajax-based system for live integration of spreadsheet data into webpages indepent of the technology used to create the webpages themselves.

  • DbToRia-Database to Rich Internet Application
    DbToRia provides a generic web interface to your database application without further coding.

  • OP Tools-System Administration Tools
    Tools we use to make or life as system administrators easier and our MERs happier.

  • Op sepp-Software Deployment System
    System to manage and deploy software packages on Un * x platforms. SEPP is able to take advantages of (de) central package storages, NFS, and auto-mounting and allows concurrent software versions.


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.