Deploy MRTG in centos6.4

Source: Internet
Author: User
Tags mrtg

1. Install MRTG and net-snmp:
Yum-y install MRTG net-snmp-utils net-snmp gcc-* Gd-* libpng-* zlib -*
2. Modify/etc/snmp/snmpd. conf
# Remove the annotator at the beginning of the line
View mib2 shortded .iso.org. DOD. Internet. Mgmt. mib-2 FC
# Modify
Access notconfiggroup "" any noauth exact systemview none
Is:
Access notconfiggroup "" any noauth exact mib2 none
3. Enable the snmpd service
Service snmpd start
Chkconfig snmpd on

# View the port enabling status
Netstat-tunlp | grep SNMP
TCP 0 0 0.0.0.0: 199 0.0.0.0: * Listen 4973/snmpd
UDP 0 0 0.0.0.0: 161 0.0.0.0: * 4973/snmpd

4. Install the apache service
Yum install httpd-y
# Modify the/etc/httpd/CONF/httpd. conf file
DocumentRoot "/var/www/html"
#
DocumentRoot "/var/www/MRTG" # direct the default web page to the MRTG directory
# Create a directory named mkdir
/Var/www/MRTG

5. Configure MRTG
# Generating a configuration file
Producer maker -- Global 'workdir:/usr/local/nginx/html/MRTG '-- Global "language: gb2312" -- Global 'Options [_]: growright, bits '-- ifref = IP -- output/etc/MRTG/mrtg. CFG [email protected] # (monitored IP address)
# The configuration file can be modified as needed

# Generate the MRTG webpage homepage File
Indexmaker/etc/MRTG/mrtg. cfg -- output =/usr/local/nginx/html/MRTG/index.html -- Title = "MRTG -- monitor -- System"

# Start MRTG
Env lang = C/usr/bin/MRTG/etc/MRTG/mrtg. cfg
# This command outputs some error messages, which can be safely ignored. You can execute this command three times in a row.

# The web pages generated by MRTG are static. to refresh the pages continuously, add the preceding commands to crontab.
Crontab-e
# Add the following line
*/2 ***** env lang = C/usr/bin/MRTG/etc/MRTG/mrtg. cfg>/dev/null 2> & 1

Note: This row indicates refresh every two minutes. You can modify the refresh interval as needed.

This article is from the "bdkyr" blog, please be sure to keep this source http://2276761.blog.51cto.com/2266761/1533796

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.