How to install linux Mrtg to monitor host traffic

Source: Internet
Author: User
Tags snmp mrtg

Most products on the market currently support the SNMP Protocol. As long as devices that support the SNMP protocol can use MRTG for monitoring, the following are the specific configurations and services for installing linux Mrtg to monitor host traffic.

(1) linux Mrtg monitors host traffic. First, modify the snmp configuration file:
# Vi/etc/snmp/snmpd. conf
Remove the annotator # before the first line of 89th and change it
View mib2 shortded .iso.org. dod. internet. mgmt. mib-2 fc
Modify in row 62:
Access notConfigGroup "" any noauth exact systemview none
Change
Access notConfigGroup "" any noauth exact mib2 none

(2) linux Mrtg monitors host traffic to start http and snmp services:
First, check whether the two services are enabled when the system starts.
# Chkconfig -- list | grep httpd
If it is not started, you need to modify the startup mode in which you want to start it yourself:
# Chkconfig -- level 35 httpd on
The following description is successful:
Httpd 0: off 1: off 2: off 3: on 4: off 5: on 6: off
Use the same settings for the snmpd service.
Start manually now
# Service httpd start
# Service snmpd start

(3) linux Mrtg monitors host traffic and begins to install mrtg
# Tar zvxf mrtg-2.14.5.tar.gz
# Cd mrtg-2.14.5
#./Configure -- prefix =/usr/local/mrtg
# Make
# Make install
"-- Prefix =/usr/local/mrtg" is the specified installation path. OK. After installation, configure mrtg

(4) linux Mrtg monitoring host traffic configuration MRTG
First, create a directory for the mrtg homepage,
The default path of Apache installed using the RPM package is/var/www/html/
Create the mrtg directory in this directory:
# Md/var/www/html/mrtg
If the path is too long, you can use symbolic links,
I created a symbolic link in ln-s/var/www/html/mrtg under the root directory.
Create another images directory under the directory created above
# Md/root/mrtg/images
After you enter the mrtg installation directory
# Cd mrtg-2.14.5
# Cp./images/*/root/mrtg/images/
Create a configuration file:
In the root directory, I also create a symbolic link mrtgbin for usr/local/mrtg/bin/. In this way, I can play less words,
#/Mrtgbin/maker public@192.168.1.50 -- global "workdir:/root/mrtg -- output =/root/mrtg/lxy. cfg

Modify the configuration file: it is already in the root directory.
# Vi mrtg/lxy. cfg
Set
# Options [_]: growright, # Before bits remove, align to the left and change it to Options [_]: growright, bytes, and the prompt "bytes" is unknown, in the past, it was not allowed to use bytes in windows, but also switched back to the original bits.
Add the Language: GB2312 at the end, and then save the wq.
Run the program
# Mrtgbin/mrtg/root/mrtg/lxy. cfg
If there is a warning error, run it several times. If the warning error does not appear again, it will be OK.

Homepage created: already in the root directory
# Mrtgbin/indexmaker -- output =/root/mrtg/index.html -- title = "leexoyo's MRTG on linux" mrtg/lxy. cfg

Set to run once every 5 minutes:
# Crontab-e edit mode Input
*/5 */root/mrtgbin/mrtg/root/mrtg/lxy. cfg
Save
Then reboot,
Http: // 192.168.1.30/mrtg you should be able to see the network usage curve.

After setting, Chinese characters are always garbled and several solutions on the Internet fail. Use E.
If you have set an intermediate firewall without enabling port 80 access, you need to edit/etc/sysconfig/iptables to allow others to access port 80.

Related Article

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.