NET-SNMP-based MRTG traffic monitoring installation and configuration in Linux

Source: Internet
Author: User
Linux based on NET-SNMP MRTG traffic monitoring installation and configuration-Linux Enterprise Application-Linux server application information, the following is a detailed reading. Operating System Environment: RHEL5/CentOS5
List of software used: Zlib/GD/LIBPNG/MRTG/NET-SNMP/Apache (there are too many installation methods on the internet, here I will not talk about it)

I. Net-Snmp Installation
I used the RPM Method for installation. There will be dependencies during the installation process. As prompted, install the relevant dependencies. When installing the net-snmt package, libsensors is required. so.3 this file, this file in the lm_sensors-2.10.0-3.1.i386.rpm, also want to install the lm_sensors-2.10.0-3.1.i386.rpm package, after installation can start snmpd service to try
Query list after installation:
[Root @ mail local] # rpm-qa | grep elfutils
Elfutils-libelf-devel-0.125-3.el5
Elfutils-0.125-3.el5
Elfutils-libelf-0.125-3.el5
Elfutils-libelf-devel-static-0.125-3.el5
Elfutils-libs-0.125-3.el5
[Root @ mail local] # rpm-qa | grep beecrypt
Beecrypt-4.1.2-10.1.1
[Root @ mail local] # rpm-qa | grep snmp
Net-snmp-5.3.1-14.el5
Net-snmp-libs-5.3.1-14.el5
Cluster-snmp-0.8-27.el5.centos
[Root @ mail local] # rpm-qa | grep lm_sensors
Lm_sensors-2.10.0-3.1
[Root @ mail local] #
Modify the content of/etc/snmp/snmpd. conf in combination with the MRTG traffic statistics:
[Root @ mail local] # vi/etc/snmp/snmpd. conf
Find the following line:
# View mib2 shortded .iso.org. dod. internet. mgmt. mib-2 fc
Remove the "#" comment in front of it:
View mib2 shortded .iso.org. dod. internet. mgmt. mib-2 fc
Find this line:
Access notConfigGroup "" any noauth exact systemview none
Modify "systemview" to "mib2" as follows:
Access notConfigGroup "" any noauth exact mib2 none
Then add a line above it:
View systemview embedded ded. 1.3.6.1.2.1.2
Save the disk and exit.
Restart the snmp service
[Root @ mail local] # service snmpd restart
The NET-SNMP configuration is over.

Ii. Installation of GD, Zlib, and LibPNG
Download the software first:
[Root @ mail local] # mkdir-p/usr/local/src
[Root @ mail local] # cd/usr/local/src
Install Zlib:
[Root @ mail src] # wget http://www.gzip.org/zlib/zlib-1.1.4.tar.gz
[Root @ mail src] # gunzip-c zlib-* .tar.gz | tar xf-
[Root @ mail src] # rm zlib-* .tar.gz
[Root @ mail src] # mv zlib-* zlib
[Root @ mail src] # cd zlib
[Root @ mail zlib] #./configure
[Root @ mail zlib] # make
[Root @ mail zlib] # cd ..
Install Libpng:
[Root @ mail src] # wget http://public.planetmirror.com/p... ibpng-1.0.15.tar.gz
[Root @ mail src] # gunzip-c libpng-* .tar.gz | tar xf-
[Root @ mail src] # rm libpng-* .tar.gz
[Root @ mail src] # mv libpng-* libpng
[Root @ mail src] # cd libpng
[Root @ mail libpng] # make-f scripts/makefile. std CC = gcc ZLIBLIB = ../zlib ZLIBINC = ../zlib
[Root @ mail libpng] rm *. so. **. so
[Root @ mail libpng] cd ..
Install GD:
[Root @ mail src] # wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz
[Root @ mail src] # gunzip-c gd-2.0.11.tar.gz | tar xf-
[Root @ mail src] # Music gd-2.0.11 gd
[Root @ mail src] # cd gd
[Root @ mail gd] # env CPPFLAGS = "-I .. /zlib-I .. /libpng "LDFLAGS ="-L .. /zlib-L .. /libpng "\
./Configure -- disable-shared -- without-freetype -- without-jpeg
[Root @ mail gd] # make
[Root @ mail gd] # cp. libs /*.

Iii. Install MRTG

[Root @ mail src] # wget ftp://ftp.idilis.ro/mirrors/mrtg/mrtg-2.16.1.tar.gz
[Root @ mail src] # tar xzfv mrtg-2.16.1.tar.gz
[Root @ mail src] # cd mrtg-2.16.1
[Root @ mail mrtg-2.16.1] #./configure -- prefix =/usr/local/mrtg-2 \
-- With-gd =/usr/local/src/gd \
-- With-z =/usr/local/src/zlib \
-- With-png =/usr/local/src/libpng
[Root @ mail mrtg-2.16.1] # make
[Root @ mail mrtg-2.16.1] # make install
After MRTG is installed, configure it.
Iv. MRGT Configuration
[Root @ mail mrtg-2.16.1] # mkdir-p/home/mrtg/cfg
[Root @ mail mrtg-2.16.1] #/usr/local/mrtg-2/bin/consumer maker -- global 'workdir:/home/mrtg '-- global' Options [_]: bits, growright '-- output/home/mrtg/cfg/mrtg. cfg public@192.168.1.3.
Here 192.168.1.3 is the snmp server (my local machine)
Generate Chart files:
[Root @ mail mrtg-2.16.1] #/usr/local/mrtg-2/bin/mrtg/home/mrtg/cfg/mrtg. cfg
You can add it to crontab and the system automatically generates the chart, as shown below:
[Root @ mail mrtg] # crontab-e
Add content (the system generates a chart every 5 minutes ):
*/5 */usr/local/mrtg-2/bin/mrtg/home/mrtg/cfg/mrtg. cfg
To generate the index.html file for viewing:
[Root @ mail mrtg] #/usr/local/mrtg-2/bin/indexmaker -- output =/home/mrtg/index.html -- title = TEST_SERVER/home/mrtg/cfg/mrtg. cfg

Next, publish the directory in apache.

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.