How to Install MRTG on Ubuntu 11.10 / Debian Squeeze

The assumption here is that apache web server already installed in system. Below is guide on how to install MRTG and SNMP packages.

1. Install MRTG and SNMP

$ sudo apt-get install mrtg snmpd

2. Configure SNMP

Backup configuration file:

$ sudo mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak

Create new configuration file:

$ sudo nano /etc/snmp/snmpd.conf

And replace the current content with these lines:

rocommunity  public
syslocation  "ColekColek"
com2sec public localhost public
group public v1 public
group public v2c public
group public usm public
view all included .1
access public "" any noauth exact all none none

Edit /etc/default/snmpd

$ sudo nano /etc/default/snmpd

And make sure the file contains these lines:

SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/ -c /etc/snmp/snmpd.conf'

Restart snmpd:

$ sudo /etc/init.d/snmpd restart

3. Configure MRTG

Create mrtg folder:

$ sudo mkdir /var/www/mrtg
$ sudo chmod o+w /var/www/mrtg

Create configuration file:

$ sudo cfgmaker --global 'WorkDir:/var/www/mrtg' --ifref=name --ifdesc=eth --global 'Options[_]: bits' --output /etc/mrtg.cfg   public@localhost

Create index file:

$ sudo indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html


$ sudo env LANG=C /usr/bin/mrtg /etc/mrtg.cfg

First execution will produce error message, this is normal. You can execute again few times. After more than 3 times of execution, the error message will be gone.

4. Create scheduled job:

$ sudo crontab -e

And add in this line:

*/5 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg.cfg

5. Done. You can check MRTG graph on http://localhost/mrtg/ or http://your_ip/mrtg/


  • ubuntu mrtg
  • mrtg debian squeeze
  • install mrtg on squeeze
  • install mrtg ubuntu
  • how to install mrtg on ubuntu
  • debian squeeze mrtg
  • mrtg ubuntu tutorial
  • snmp ubuntu 11 10
  1. Sidharatha Reply
    • kumkum Reply
  2. kumhelp Reply
    • kumkum Reply
  3. Conrado Reply
    • kumkum Reply
  4. Isaac Granados GOmez Reply
    • kumkum Reply
  5. suwapit Reply
    • kumkum Reply
  6. suwapit Reply
  7. Tamas Reply
    • kumkum Reply

Leave a Reply

Your email address will not be published. Required fields are marked *