FreeBSD/MRTG

Installing the ports tree
Start out by installing the FreeBSD's Ports system: portsnap fetch && portsnap extract && portsnap fetch update

Installing MRTG and SNMPD
Install SNMPd port with: cd /usr/ports/net-mgmt/net-snmp; make install Then install MRTG port with: cd /usr/ports/net-mgmt/mrtg ; make install

Configure SNMP
# # # # # # syslocation My Country syscontact Name - email@domain.com # rocommunity public localhost
 * Then copy the code below, and edit to this location: /usr/local/share/snmp/snmpd.conf
 * 1) /usr/local/share/snmp/snmpd.conf
 * 1) snmpd.conf
 * 1) - created by the snmpconf configuration program
 * 1) SECTION: System Information Setup
 * 1) SECTION: System Information Setup
 * 1) This section defines some of the information reported in
 * 2) the "system" mib group in the mibII tree.
 * 1) syslocation: The [typically physical] location of the system.
 * 2) Note that setting this value here means that when trying to
 * 3) perform an snmp SET operation to the sysLocation.0 variable will make
 * 4) the agent return the "notWritable" error code. IE, including
 * 5) this token in the snmpd.conf file will disable write access to
 * 6) the variable.
 * 7) arguments: location_string
 * 1) syscontact: The contact information for the administrator
 * 2) Note that setting this value here means that when trying to
 * 3) perform an snmp SET operation to the sysContact.0 variable will make
 * 4) the agent return the "notWritable" error code. IE, including
 * 5) this token in the snmpd.conf file will disable write access to
 * 6) the variable.
 * 7) arguments: contact_string
 * 1) SECTION: Access Control Setup
 * 1) SECTION: Access Control Setup
 * 1) This section defines who is allowed to talk to your running
 * 2) snmp agent.
 * 1) rocommunity: a SNMPv1/SNMPv2c read-only access community name
 * 2) arguments: community [default|hostname|network/bits] [oid]

Starting SNMPD
Add snmpd_enable= "YES" to /etc/rc.conf and save. Then type /usr/local/etc/rc.d/snmpd start

Configure MRTG using cfgmaker

cfgmaker --global 'WorkDir: /usr/local/www/data-dist/mrtg' --global 'Options[_]: growright,unknaszero' --output /usr/local/www/data-dist/mrtg.cfg public@localhost

/usr/local/www/data-dist/mrtg = The location you want at your webserver /usr/local/www/data-dist/mrtg/mrtg.cfg = The location you want of your mrtg.cfg

Edit this to suite your needs. dumburk is the name of my machine. If you wanna change, you need to edit both snmpd.conf and edit cfgmaker command before run.

OK. Now everything should be setup right try run /usr/local/bin/mrtg /path/to/mrtg.cfg Adding the following command to /etc/crontab will update mrtg-graphs every 5th minute. */5 * * * * root /usr/bin/env LANG=C /usr/local/bin/mrtg /path/to/mrtg.cfg --logging /var/log/mrtg.log This guide is a couple of years old, but still works great.
 * http://oss.oetiker.ch/mrtg/
 * http://www.net-snmp.org/
 * http://www.FreeBSD.org