« Today’s interview | Home | Advise for CS Students »

September 20, 2005

Installing MRTG on a FreeBSD machine

Install SNMP using Ports

# cd /usr/ports/net-mgmt/net-snmp # make && make install && make clean

Add Two Lines into /etc/rc.conf

snmpd_enable=”YES” snmpd_flags=”-a -Lsd -p /var/run/snmpd.pid”
# chmod 444 /usr/local/etc/rc.d/snmptrapd.sh

Configure snmpd.conf

# snmpconf -i a. Edit snmpd.conf b. Choose : System Information Setup c. You will get 1: The [typically physical] location of the system. 2: The contact information for the administrator 3: The proper value for the sysServices object. d. Fill up 1 and 2. Please pay attention to option 3 e. When finish, back to main menu and choose 2. f. Choose 3, a SNMPv1/SNMPv2c read-only access community name h. Put in community name such as, foo i. In hostname and network mask we enter 127.0.0.1 j. Setup OID , leave blank k. Back to menu l. The IP address and port number that the agent will listen on.
Finish generate configuration file.
# /usr/local/etc/rc.d/snmpd.sh start

Install MRTG using ports

# cd /usr/ports/net-mgmt/mrtg # make && make install && make clean

Configure file for MRTG

# cfgmaker foo@127.0.0.1 > /usr/local/etc/mrtg/mrtg.cfg

Edit /usr/local/etc/mrtg/mrtg.cfg , put in Apache Directory
Adding Cron Jon

# crontab -e

Insert

*/5 * * * * /usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg

Launch Brower and view the file.

Posted by Lifeng Shen on September 20, 2005 5:24 PM |

评论

添加评论







固定链接与引用