- Installing Support Packages
Yum–y install gcc perl gd libpng zlib net-snmp MRTG
Configure SNMPD
Edit/etc/snmp/snmpd.conf File
Back up the snmpd.conf file and create a new blank snmpd.conf. Add the following to save
Com2sec notconfiguser localhost public
Group Notconfiggroup v1 Notconfiguser
Group Notconfiggroup v2c Notconfiguser
View SystemView included. 1.3.6.1.2.1.1
View SystemView included. 1.3.6.1.2.1.25.1.1
Access Notconfiggroup "" Any noauth exact none none
View all included. 1 80
Syslocation Unknown (edit/etc/snmp/snmpd.conf)
Syscontact Root
- Restart SNMPD After the modification is complete
Service SNMPD Restart
Chkconfig snmpd on
- Configure MRTG
The default MRTG configuration file is saved in the/etc/mrtg/mrtg.cfg
We recommend that you use commands to generate mrtg.cfg templates.
Cfgmaker [email protected]--output/etc/mrtg.cfg
- Modify the/etc/mrtg.cfg file
Just change the Workdir: to access the path
such as: Workdir:/VAR/WWW/MRTG
Mkdir/var/www/mrtg
- Build MRTG Home
Indexmaker/etc/mrtg/cfg >/var/www/mrtg/index.html
Empowering: chmod 777/usr/bin/rateup
- plot a data diagram using MRTG
Env LANG=C/USR/BIN/MRTG/ETC/MRTG.CFG
- Create a timed task
*/5 * * * * env LANG=C/USR/BIN/MRTG/ETC/MRTG.CFG
- Modify/etc/httpd/conf.d/mrtg.conf (only native access is run by default)
Alias/mrtg/var/www/mrtg
<Location/mrtg>
Order Deny,allow
Deny from None
Allow from all
Allow from:: 1
# Allow from. example.com
</Location>
Restart Apache Access http://your-ip/mrtg/
Reference: http://my.oschina.net/jack230230/blog/150470 (including CPU, memory monitoring)
CentOS Install MRTG