First, we’re goin’ to install snmpd.cd
/usr/ports/net-mgmt/net-snmpmake install clean
Edit /etc/rc.conf end insert this lines:snmpd_enable=”YES”
Edit /usr/local/share/snmp/snmpd.conf
com2sec local (source address, localhost if mrtg and snmpd are on
the same host) (community name)group MyROGroup v1 localgroup
MyROGroup v2c localgroup MyROGroup usm localview all included
.1 80access MyROGroup “” any noauth exact all none
none
Start snmpd/usr/local/etc/rc.d/snmpd start
Test if snmpd is running and works withsnmpwalk -v 1 -c
community_name hostname_where_run_snmp system
Now we must install Apache, I use apache21, but you can install
version 2.2 or 2.0 if you prefer.cd /usr/ports/www/apache21/make
install clean
Finally we must install mrtgcd /usr/ports/net-mgmt/mrtg/make
install clean
Edit /usr/local/etc/apache21/httpd.conf to set ServerName
Directory and other few lines to asjust configuration of apache.
Then we must create config file for mrtg. Lunch:cfgmaker
community@hostname_where_run_snmp > /usr/local/etc/mrtg/mrtg.cfg
Now create index from cfg file:indexmaker
/usr/local/etc/mrtg/mrtg.cfg >
/home/web/mrtg/index.htmlSubstitute /home/web/mrtg/index.html
with path that you’ve specified in httpd.conf for graph web
viewing.
Now just remain to insert in crontab mrtg update command
so:crontab -eInsert into them:*/5 * * * *
/usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg
You should have mrtg work.
If you have some problems, try to lunch mrtg withmrtg
–debug=”cfg,snpo” /path/of/mrtg.cfg
Have fun.