This doc shows how to setup SNMPv2c and MRTG on Red Hat 9 Server. Thanks to O’Reilly Press (http://www.oreilly.com/) Essential SNMP (ISBN 0-596-00020-0).
NET-SNMP
1. Remove old SNMP package and install the latest net-snmp package from http://net-snmp.sourceforge.net/. Select SNMPv2c by now
2. Generate snmpd.conf, and put it under ~/.snmp or /usr/local/share/snmp
2.1. Use /usr/local/bin/snmpdconf
2.2. Create manually
3. Start /usr/local/sbin/snmpd
4. Test with snmpwalk server –c public_community OID
E.g.
snmpwalk x.x.x.x –c public system
snmpwalk x.x.x.x –c public .1.3.6.1.2.1.1
Pleas refer to the SNMP MIB-II OID Tree.
[root]
[ccitt(0)]—[iso(1)]—[joint(2)]
[org(3)]
[dod(6)]
[internet(1)]
[directory(1)]—[mgmt(2)]—[experimental(3)]—[private(4)]
[mib-2(1)]
[system(1)]—[interfaces(2)]—[at(3)]—[ip(4)]—[icmp(5)]—[tcp(6)]—[udp(7)]—[egp(8)]—[transmission(10)]—[snmp(11)]
5. Create script to start/stop snmpd service in /etc/init.d
MRTG
1. Install libpng from http://www.libpng.org/pub/png/
2. You may need to install zlib from http://www.gzip.org/zlib/
3. Install gd from http://www.boutell.com/gd/
4. Install mrtg from http://people.ee.ethz.ch/~oetiker/webtools/mrtg/
5. Copy mrtg-x.y.x/image/mrtg*.gif to $WEB_ROOT/mrtg/images
6. Create mrtg.cfg
/usr/local/mrtg-2/bin/cfgmaker --global “WorkDir:$WEB_ROOT/mrtg/images” --output $WEB_ROOT/mrtg/mrtg.cfg public_community@server
7. Test mrtg several times until the error messages are all fixed
/usr/local/mrtg-2/bin/mrtg $WEB_ROOT/mrtg/mrtg.cfg
8. Add it to crontab
*/5 * * * * /usr/local/mrtg-2/bin/mrtg $WEB_ROOT/mrtg/mrtg.cfg
9. Generate optional index page
/usr/local/mrtg-2/bin/indexmaker –title “XYZ” --output $WEB_ROOT/mrtg/images/index.html $WEB_ROOT/mrtg/mrtg.cfg
Comments
Post a Comment