Installing MRTG on uBuntu

apt-get install mrtg snmpd snmp

Edit the mrtg configuration file to edit some of the settings
File is located at /etc/mrtg.cfg you need to change the global settings as follows :
 

# Global Configuration

RunAsDaemon: yes
EnableIPv6: no
WorkDir: /var/www/mrtg
Options[_]: bits,growright
WriteExpires: Yes

Title[^]: Traffic Analysis for

Edit the snmp community name in snmp configration file /etc/snmp/snmpd.conf

# sec.name source community
# com2sec paranoid default public
com2sec readonly default public
#com2sec readwrite default private

Now you need to restart the snmp service
 

#/etc/init.d/snmpd restrat

Creating the configuration file using
 

#cfgmaker public@localhost > /etc/mrtg.cfg

Creating a configuration file for a device using
 

#cfgmaker public@192.168.0.1 >> /etc/mrtg.cfg

Create index file for the webserver
 

#indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html