MRTG
First you need to install snmpd from portsThen install MRTG from ports
cd /usr/ports/net-mgmt/mrtg make install
Make web server dirs ready
mkdir /usr/local/www/apache22/data/stats chown mrtg /usr/local/www/apache22/data/stats
Check your interface index
snmpwalk -v 2c -c read2user localhost IP-MIB::ipAdEntIfIndex IP-MIB::ipAdEntIfIndex.78.47.207.147 = INTEGER: 1 IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 2
(See the 1 after the IP 78.47.207.147. This is what we want to use in the config file next)
Make a simple config file (/usr/local/etc/mrtg/mrtg.cfg) to begin with
WorkDir: /usr/local/www/apache22/data/stats Target[confighell]: 1:read2user@localhost MaxBytes[confighell]: 10240000 Title[confighell]: Traffic on Confighell PageTop[confighell]: <H1>Stats for Confighell</H1>
(See the link between Target[confighell]: 1:* and the index we just found before)
Start MRTG daemon
echo mrtg_daemon_enable="YES" >> /etc/rc.conf /usr/local/etc/rc.d/mrtg_daemon start
See also
Cacti?
