Monitoring the network interfaces
The previous page gives you a setup which will monitor basic information about the email; you can also monitor network traffic but for this you need to have snmp installed.
cd /usr/ports/net-mgmt/net-snmp make install
Now edit the file /usr/local/share/snmp/snmpd.conf (it may be empty) and complete the following info. (replace the top 2 with your data!)
syslocation WEG07 syscontact postmaster@cnwl.ac.uk sysservices 79 rocommunity public agentuser root agentgroup wheel agentaddress 161
Edit /etc/rc.conf and add the following line so that the snmp daemon will start at boot time.
snmpd_enable="YES"
Restart the machine and then type:
snmpwalk -c public -v 2c localhost system
to test the snmp install (the data returned doesn't matter - if you don't get errors then it's OK!)
Finally, to make mrtg collect data every 5 minutes add the following to /etc/crontab:
0-59/5 * * * * root /usr/local/bin/mrtg /usr/local/etc/mailscanner-mrtg/mailscanner-mrtg.cfg
This specifies that the command shown will be run as root every 5 minutes – this generates all the web pages.
