first of all, check that you have mrtg installed. if not, then:
apt-get install mrtg
updatedb && locate mrtg
create the /etc/mrtg folder and move the cfg file
mkdir /etc/mrtg && sudo mv /etc/mrtg.cfg /etc/mrtg
create the working directory
create config file for your monitored device
cfgmaker --output=/etc/mrtg/mrtg.cfg public@your-router's-IP-address
open /etc/mrtg/mrtg.cfg in a text editor and make sure the line “WorkDir: /var/www/mrtg” (under Debian) is uncommented, and under Global Defaults the line “Options[_]: growright, bits” is uncommented.
add the following lines to mrtg.cfg under the Global Defaults
create the /var/www/mrtg/index.html file according to your monitored device's cfg file
indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg
run mrtg with your monitored device's cfg file
env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
this is about it. if you get an error, run:
mkdir -m 0755 /var/lock/mrtg
MRTG settings in /usr/local/nagios/etc/objects/switch.cfg should be changed from '/var/lib/mrtg' to '/var/www/mrtg', also this applies to any other cfg file that will be using mrtg
check nagios configuration and run nagios. you should get the right data in less then a minute.
also check yourserver/mrtg for some nice graphical displays and consider securing this folder with .httaccess or other methods.
This is a modified version of a small tutorial i found on google,
hope it helped.