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