Networking → How to Install and Configure MRTG on Ubuntu Server
(2.28.10) – This post was amended to include minor editorial corrections — iceflatline)
This post will describe how to install and configure Tobi Oetiker’s MRTG (Multi Router Traffic Grapher) on your Ubuntu home server. Once configured, you’ll be able to use it to monitor the traffic in and out of your home network using the SNMP capability in your network’s gateway/router. MRTG generates static HTML pages containing PNG images which provide a visual representation of this traffic. MRTG typically produces daily, weekly, monthly, and yearly graphs. MRTG is written in perl and works on Unix/Linux as well as Windows. MRTG is free software licensed under the GNU GPL.
Software versions used in this post were as follows:
So, let’s get started.
Download and Install
First, download and install MRTG:
sudo apt-get install mrtg
If this is the first time installing MRTG on your server you’ll likely be presented with the following message. Answering “Yes” means that the default configuration file will be installed with permissions set at 640. Answering “No” means that the permissions are set at 644. In this example we’re going to accept the default Yes. No worries though, if you select No the steps in this tutorial will still work.

MRTG installs a sample configuration file /etc/mrtg.cfg. This file will eventually hold the information obtained from your gateway\router. For a full listing of what MRTG installs and where, run the locate command:
sudo updatedb && locate mrtg
Technically speaking, mrtg.cfg could remain in /etc, but just to keep things tidy and to help facilitate the startup script that will be discussed later, let’s create a directory for it and move it into that directory:
sudo mkdir /etc/mrtg && sudo mv /etc/mrtg.cfg /etc/mrtg
That’s it for installing MRTG. Now let’s move on and configure it.
Configure
MRTG includes a script called cfgmaker that will help us populate mrtg.cfg with the information obtained from your gateway/router. But before you run cfgmaker, you should setup the SNMP community. This usually involves logging into your gateway/router and enabling SNMP. The default community will typically be “public.” If you change the default community to another name though, make note of it. Now, run the following command, substituting the SNMP community name, if you’ve changed it, and adding the IP address of your gateway/router:
sudo cfgmaker --output=/etc/mrtg/mrtg.cfg public@your-router's-IP-address
Next, open mrtg.cfg in a text editor and make sure under Global Configiration Options that the line “WorkDir: /var/www/mrtg” (under Debian) is uncommented, and under Global Defaults the line “Options[_]: growright, bits” is uncommented. Finally, add the following lines under the Global Defaults section:
RunAsDaemon: Yes Interval: 5 Logdir: /var/log/ EnableIPv6: no
What does all this do? RunAsDaemon will enable MRTG to…um… run as a daemon. This is beneficial because MRTG is launched only once, thus the parsing of mrtg.cfg file is done only once, not repeatedly as would be the case if one were to run MRTG as a cron task – another acceptable method for running MRTG. Also, when running as a daemon, MRTG itself is responsible for timing the measurement intervals; therefore, we need to add the Interval option and assign it a value – in this case 5 (minutes). This means that every five minutes MRTG will update its graphs. We’ve given MRTG a directory to place its log file, and finally, because many routers do not currently support SNMP over IPv6, we’ve shut that off.
Speaking of graphs, by default MRTG graphs grow to the left, so by adding the option “growright” the direction of the traffic visible in MRTG’s graphs flips causing the current time to be at the right edge of the graph and the history values to the left. We’ve also chosen the “bits” option, which means that the monitored traffic values obtained from your gateway/router are multiplied by 8 and displayed bits per second instead of bytes per second.
Okay, now it’s time to create the web pages which display the MRTG graphs. Run the following commands:
sudo mkdir /var/www/mrtg sudo indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg
MRTG has been configured. Let’s start it up and see what it displays.
Start
There’s something important to keep in mind when starting MRTG, and that is that MRTG requires the environmental variable “LANG” to be C in order to run properly. Since most Linux systems these days, including Ubuntu server, use UTF-8 (run echo $LANG to see what your system uses), let’s change LANG to C and start MRTG using the following command:
sudo env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
When you run MRTG for the first time you may see a lot of complaints about missing log files. No worries, this is normal for the first 2-3 times you start MRTG this way. If, however, it continues to complain you may want to look into the source of the problem.
Well, that’s it. Now point your browser to http://your-server-address/mrtg and you should see a page that resembles the following. You may have more or less graphs depending on the number interfaces reported by your gateway/router.
Because of the aforementioned options added to mrtg.cfg, you’ll see the graph starting “grow” to the right as the traffic is monitored over time, and the Y axis displayed as bits per second. If you click on any one of these graphs you’ll be taken to another page showing individual graphs for daily, weekly, monthly, and yearly traffic averages, along with the maximum, average, and current bit rate in and out of that particular interface. Only interested in displaying one particular interface? Don’t like the look of the page? No worries, just edit /etc/mrtg/mrtg.cfg and/or /var/www/mrtg/index.html until you get it looking the way you want.
Okay, so now that we have MRTG installed, configured and running let’s move on and discuss how to keep it running.
Operate
Starting MRTG by hand is not ideal in the long run. So perhaps after you’ve done some tweaking on MRTG and are satisfied with the results, you can automate the process of running MRTG by using a startup script in your system startup sequence. Here’s the script that I use:
#! /bin/sh
### BEGIN INIT INFO
# Provides: mrtg
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: mrtg init script
# Description: This file is used to start, stop, restart,
# and determined status of the mrtg daemon.
# Author: iceflatline <iceflatline@gmail.com>
### END INIT INFO
### START OF SCRIPT
set -e
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="mrtg"
NAME=mrtg
DAEMON=/usr/bin/$NAME
DAEMON_ARGS="/etc/mrtg/mrtg.cfg"
PIDFILE=/etc/mrtg/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Exit if the mrtg package is not installed
[ -x "$DAEMON" ] || exit 0
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
# Function that starts the mrtg daemon
start()
{
env LANG=C start-stop-daemon --start --quiet \
--exec $DAEMON -- $DAEMON_ARGS
}
# Function that stops the mrtg daemon
stop()
{
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
--pidfile $PIDFILE
}
case "$1" in
start)
log_daemon_msg "Starting $DESC"
start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;;
esac
;;
stop)
log_daemon_msg "Stopping $DESC"
stop
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;;
esac
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC"
stop
case "$?" in
0|1)
start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;;
esac
;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME"
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}"
;;
esac
exit 0
### END OF SCRIPT
To use the script, save it to your home directory as mrtg and make it executable. Then move or copy it to /etc/init.d:
cd ~ chmod +x mrtg sudo mv mrtg /etc/init.d/
Now, link the mrtg script to all of Ubuntu server’s multi-user run levels (2-5):
sudo update-rc.d mrtg defaults
Now, let’s start MRTG using our script. If it’s currently running then substitute restart for start in the following command:
sudo /etc/init.d/mrtg start
That’s it. Now if for some reason your server is rebooted, MRTG should fire up automatically (to remove the link from the server’s multi-user run levels, use the command sudo update-rc.d -f mrtg remove).
Conclusion
This concludes the post on how to install and configure MRTG on Ubuntu server. As you can see, MRTG isn’t terribly complicated and proves to be a really nice open source package for monitoring and displaying traffic in and out your home network from virtually anywhere you have a web browser. For a full list of all the configuration options and other information I encourage you to visit the MRTG web site.
References
http://oss.oetiker.ch/mrtg/doc/index.en.html
Tags: Networking, server, ubuntu

September 21st, 2009 at 8:21 pm
Thanks for this great write-up! I am using your startup script, and I think it’s great. I did have some trouble finding the RDDs.pm tool, but a quick “apt-get install librrds-perl” fixed everything!
September 22nd, 2009 at 7:16 am
Thanks for your kind words Tim, glad you enjoyed the post.
September 23rd, 2009 at 11:21 pm
Fantastic. THanks very much :)
combing Google for hours looking for a good tutorial. As a new linux user I’ve found this was the only one that could lead me to get it working :)
And that script is fantastic, before that I wasn’t sure how to stop and start it!!!
Cheers.
September 24th, 2009 at 3:13 pm
Hamish, you’re very welcome.
September 28th, 2009 at 8:13 am
HI, thats great , but I’ve problem with this startup script, after Ubuntu bootup it’s telling me: /etc/rc2.d/S99mrtg: 49: –daemon: not found
And it’s not starup with Ununtu, only manual starup
September 28th, 2009 at 10:09 am
ask123, there are a couple of things you might check:
Make sure that the mrtg.cfg file contains the “RunAsDaemon: yes” line under Global Defaults section;
make sure the script reflects accurately the locations of the directories and files where you’ve set up MRTG;
make sure the symbolic links to the script from /etc/rc2.d are correct (you might also make sure the server is starting up in run level 2);
make sure the mrtg script under /etc/init.d is set is set to be executable by owner, group and other; and finally,
make sure that mrtg.pid file is being written to /var/run.
If for some reason these steps don’t get you running, then you might trying running MRTG under cron.
September 30th, 2009 at 11:05 am
Big props on the great how-to! Very nice, worked like a charm.
September 30th, 2009 at 6:41 pm
pym93, thanks! Glad you enjoyed it.
October 14th, 2009 at 8:08 am
thank you iceflatline for sharing this guide..very useful very convenient very useful
October 26th, 2009 at 11:38 pm
Hi, i’m Indonesian. Many thanks for your great tutorial Bro!
October 27th, 2009 at 11:05 am
You’re very welcome! Thanks for the comment.
March 1st, 2010 at 12:13 am
Thank you for sharing this guide.
#For openSUSE 11.2, SLES
$ ln -s /etc/init.d/mrtg /etc/rc2.d/S99mrtg
$ ln -s /etc/init.d/mrtg /etc/rc2.d/K99mrtg
Change to:
$ ln -s /etc/init.d/mrtg /etc/init.d/rc2.d/S99mrtg
$ ln -s /etc/init.d/mrtg /etc/init.d/rc2.d/K99mrtg
Regards,
http://www.susethailand.com/suseforum/
March 1st, 2010 at 9:00 am
Thanks Sontaya!
March 14th, 2010 at 6:09 am
Hi,
Thanks for the great post?
Any plans for adding password protection to this :>
March 14th, 2010 at 12:24 pm
noobie, thanks for your comment. I assume you mean password protection for MRTG? I have no plans but perhaps the developer does. You may want to post your question to them directly. However, if all you’re interested in is protecting access to the MRTG page(s) themselves you might consider using a simple approach like an .htaccess file in the MRTG folder root.
March 26th, 2010 at 11:52 am
@noobie
You could use an .htaccess in your /var/www/mrtg and setup user/password with the Apache’s “htpasswd” utility, that’s how i password protected mrtg stats on my dedicated server.
April 18th, 2010 at 1:12 pm
Great tutorial!
Many thanks from Romania :)!
April 18th, 2010 at 2:08 pm
sil nic, you’re welcome. How’s things in Romania?
June 29th, 2010 at 8:15 pm
Just wanted to let you know, your guide is great. Wish some of the others put this very simple procedure so simply. Short, sweet and to the point.
Thanks from Albany, NY
June 29th, 2010 at 10:51 pm
Roy, thanks for your kind comments!
July 1st, 2010 at 3:14 am
Many thanks iceflatline. It’s very helpful for me. I am from IRAQ BAGHDAD. I think nobody like me. But still I like my country, any way I need to ask you, how can I add more than 2 routers. I have 2 dedicated comtech VSAT modems and I need to check there traffic from my end.
Regards
Ammar
July 1st, 2010 at 2:02 pm
Ammar, no worries my friend, not all Americans are the same. You are certainly welcome here. Thanks for taking the time to post, and for your question.
It’s quite easy to add other SNMP devices. Simply append the additional URL to the cfgmaker command described above, like this:
See http://oss.oetiker.ch/mrtg/doc/cfgmaker.en.html
July 12th, 2010 at 10:27 am
IceFaltline ,
Really I am very grateful to you for your cooperation with me.
Do you have any idea about how to configure the mrtg on windows?
Regards
Ammar
July 14th, 2010 at 10:08 am
Ammar, no problem.
Purportedly Windows is supported, although I have not tried to install it myself. See this article at the MRTG web site.
July 17th, 2010 at 3:51 am
iceflatline,
I installed it on windows but the problem when I try to access it http://ipaddress/mrtg .. nothing appears to me.
Regards
July 17th, 2010 at 9:26 am
Ammar, it works a little differently under Windows. First make sure you have followed all the steps called for in the MRTG documentation. Then, run perl mrtg .cfg from your ~:\mrtg\bin directory. Let it run for 5-10 minutes to collect data, then run the command again. Navigate to the WorkDir you created when using cfgmaker and you should find a html file there with the results.
This other guide may be helpful for you too.
Good luck!
September 19th, 2010 at 1:54 pm
First thanks for this nice tutorial!
I was trying to create mrtg for localhost machine, but having following error. Need some suggestion.
cfgmaker –output /etc/mrtg/mrtg.cfg public@localhost
indexmaker –output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg
Use of uninitialized value $first in hash element at /usr/bin/indexmaker line 353
September 20th, 2010 at 12:30 pm
Iqbal, I’ve not encountered that error before. The fact that you’re using “localhost” as the address suggests that you’re attempting to gather information from the same host you’re installing MRTG on? Perhaps the SNMP daemon in that host is mis-configured? Anyway, a bit of googling on the error suggests this guide may help: http://www.my-guides.net/en/content/view/23/26/.
Good luck and please post again when you’ve resolved it so others may benefit.
November 2nd, 2010 at 3:05 pm
thats very coooool :)
thanks a lot from Mongolia UB
January 17th, 2011 at 2:37 am
That’s great job…Thanks alot from luckysanj…very very nice hints & nice tutorial..
February 10th, 2011 at 11:52 pm
Hi, thank you very much for sharing this information, I’m having problems at the point to see the page, I’m pointing my browser to http://my-ip-address/mrtg but I get a problem loading page, can you please tell me what I’m doing wrong?
February 11th, 2011 at 9:44 am
supernoob, thanks for posting your question. In that step I did not intend for you to literally use the URL “http://your-server-address/mrtg”. My intent there was for you to fill in the actual IP address of your server. So, you should be using something like http://192.168.1.2/mrtg or whatever your IP address happens to be for your Apache web server.
My apologies for the confusion.
February 11th, 2011 at 11:56 am
Thank you very much for your reply and support, I did point it to the IP address of the host where I installed the software, I followed all the steps and I see data already pulled from the device if I edit the mrtg.cfg file, however when I tried to load the page I get the error, I was planning to try today maybe I haven’t enable apache on my ubuntu box, I’m completely new to Ubuntu also. Do you think that can be the case?
February 11th, 2011 at 6:55 pm
iceflatline I really appreciate the work you have done here, I got it to work. I was missing the apache installation and after that it worked perfectly!! Thank you.
February 11th, 2011 at 9:17 pm
supernoob, yup, that would certainly be a problem! I’m glad you got it running. Thanks for posting back.
February 26th, 2011 at 10:20 pm
Thx for this very detailed tutorial… I’m also stuck on the error :
“Use of uninitialized value $first in hash element at /usr/bin/indexmaker line 353.”
The link that you have provided above doesn’t give me hint for a possible solution. What do you mean with : “perhaps the SNMP server in the host is mis-configured?”
February 27th, 2011 at 9:55 am
Thanks for the totorial…….but i encountered a following error……..
I am trying to install mrtg….i am in the last step in completing the process but when i entered the command..
indexmaker –output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg
it gives the following error.
Use of uninitialized value $first in hash element at /usr/bin/indexmaker line 353.
I searched it on google but i don’t get the proper answer..plz help me out..
February 27th, 2011 at 11:29 am
I have not encountered this error before. I’ll see if I can duplicate it.
February 28th, 2011 at 1:24 pm
I have run through the steps discussed in the post, installing MRTG on Ubuntu Server v10.04 LTS (x64), and polling a gateway at 192.168.10.1 with a SNMP community string of “public.” This setup worked fine and I encountered no errors when configuring MRTG. I would suggest making sure that SNMP daemon in the device your trying to poll is setup correctly and that you are using the correct URL and SNMP community string (typically “public”).
March 10th, 2011 at 5:53 pm
Worked great first try! The init.d script was especially helpful. Great job!
March 11th, 2011 at 9:00 am
My pleasure Leif, thanks for your comments.
April 28th, 2011 at 10:39 am
Terrific! Epic guide.
April 29th, 2011 at 7:09 am
My pleasure Niclas, thanks for the kind words.
June 14th, 2011 at 6:51 am
Wow, Thanks a lot coz I was struggled with this for few days with windows and now its working nicely. Thanks again.. ;)
June 14th, 2011 at 5:56 pm
Tharaka, excellent; glad it helped.
June 17th, 2011 at 4:41 am
thank you very much for the guide.
I was breaking my head yesterday both from the Tobi Oetiker’s and others to understand how to install mrtg.
This morning I’ve found your site and the solution to my problems.
I’ve successfully installed, configured and started mrtg.
Really thanks!
Greetings from Italy! :)
June 18th, 2011 at 12:30 pm
Ciao cyberfido. You’re welcome, I’m glad the post was of help to you.
July 26th, 2011 at 10:54 am
thank you so much for the easy to follow guide. i encountered a problem though. i followed the procedure carefully but the graph failed to start. here what shows up after i put “http://ipa.ddr.ess/mrtg/” in the browser:
Not Found
The requested URL /mrtg/ was not found on this server.
Apache/2.2.14 (Ubuntu) Server at ipa.ddr.ess Port 80
Below what happens in the cli when I execute “mrtg”:
katsumoto@ubentoboxx:~$ mrtg
———————————————————————–
ERROR: Mrtg will most likely not work properly when the environment
variable LANG is set to UTF-8. Please run mrtg in an environment
where this is not the case. Try the following command to start:
env LANG=C /usr/bin/mrtg
———————————————————————–
katsumoto@ubentoboxx:~$
katsumoto@ubentoboxx:~$
I did try to execute “sudo env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg” a couple of times though hoping to clear the error. Any help is appreciated.
July 26th, 2011 at 1:58 pm
katsumoto, sorry you’re encountered difficulties. It appears MRTG isn’t starting for you. You can use ps -e | grep mrtg to confirm. What version of Ubuntu server did you use? Is it possible that MRTG did not get installed at /usr/bin/ or its config file at /etc/mrtg/mrtg.cfg?
July 26th, 2011 at 4:17 pm
this is my Ubuntu server version:
Linux 2.6.32-33-generic-pae #70-Ubuntu SMP i686 GNU/Linux
Ubuntu 10.04.2 LTS
the daemon is running and MRTG is properly installed at /usr/bin/ and config file looks good a /etc/mrtg/mrtg.cfg though
July 26th, 2011 at 8:52 pm
katsumoto, thanks. I am running 10.04.3 and it seems to work fine for me as of a few minutes ago. Are you sure that mrtg is running? If so, it’s unclear to me why you would be getting that error.
August 1st, 2011 at 9:32 am
ERROR: Creating templock /var/lock/mrtg/_etc_mrtg_mrtg.cfg_l_1688: No such file or directory at /usr/bin/mrtg line 1833.
I installed after your steps first mrtg working good but after use your script is not working where is the problem. I dont have installed mrtg in /var/lock/mrtg ????
August 1st, 2011 at 8:48 pm
MrtgProblem, when MRTG starts it creates two files: /etc/mrtg/mrtg.pid and /var/lock/mrtg/_etc_mrtg_mrtg.cfg_l. Remove these two files and/or any other *.pid or *.cfg files that may be contained within these those two directories, then start MRTG manually using
and verify it works. If it does, then run
to stop it and then start it again using the script
August 2nd, 2011 at 6:50 am
i dont have this files in /etc/mrtg only mrtg.cfg but still not working
August 2nd, 2011 at 12:34 pm
MrtgProblem, sorry you’re having problems. I have not encountered that error before and I verified today that the steps as written do work on both Ubuntu Server v10.04.3 x64 and v11.04 x64.
Which version of Ubuntu Server are you using? Are you saying that MRTG will start if you use the command sudo env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg, but not if you use the script?
August 4th, 2011 at 3:42 am
if i want start mrtg
sudo env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
[sudo] password for black:
2011-08-04 09:40:23: ERROR: Creating templock /var/lock/mrtg/_etc_mrtg_mrtg.cfg_l_5603: No such file or directory at /usr/bin/mrtg line 1833.
it not working mrtg stop working after use your script and reboot machine
use UBUNTU 10.04.3
August 4th, 2011 at 10:02 am
MrtgProblem, my inelegant advice at this point would be to completely uninstall MRTG from your system and start over. Make sure to use the search tool of your choice to find and delete any leftovers (e.g. /var/log/mrtg and /var/www/mrtg). Another thing to keep in mind when/if reinstalling is there is no requirement to run the script. You could simply start MRTG manually or run it under cron. Good luck and I hope you get it running.
August 5th, 2011 at 6:51 am
if i reinstall mrtg ist working but after install your script its down, i must try with cron ;) ok thx
August 16th, 2011 at 3:05 am
Wow. really a very appreciated work man…
Now i want to one things more…i got mrtg graph of my router Fast ethernet port 1 to 4 but Can u suggest me how can i fetch the particular IP’s usage used on ether3 interface which are on vlan.
August 18th, 2011 at 4:35 pm
luckysanj, having not done that before I’m unsure; however, you might try looking at the Interface by IP section of the MRTG configuration reference to see if that will meet your needs.
October 20th, 2011 at 1:13 am
Hi Iceflatline, thank you very. This is the best MRTG reference I’ve seen on the net. It works like a charm on a single router. Now, I have a quick question. How would I setup a MRTG to monitor about 80 routers? I have seen your suggestion using the script below for 2 routers but I don’t think it is the best solution for my scenario.
sudo cfgmaker –output /etc/mrtg/mrtg.cfg public@your-router’s-IP-address public@your-router’s-IP-address
Any suggestion is highly appreciated.
Thanks again.
October 20th, 2011 at 10:13 am
ern, thanks for your kind words.
~80! That’s quite a few, and I’m afraid beyond my practical experiences so far with MRTG. Doing a quick Google search on mrtg+support+multiple+routers, however, suggests there are at least a few threads out there with people discussing how they have approached this level of scaling.
Good luck and please post back when/if you discover an approach that works for you. I would be interested in knowing.
November 3rd, 2011 at 2:58 am
Thanks for this helpful post,
i successfully installed and am running MRTG as of right now, i am a beginner at this and still cannot integrate other devices in it, i tried the (sudo cfgmaker –output /etc/mrtg/mrtg.cfg public@your-router’s-IP-address public@your-router’s-IP-address) command but for some reason i cannot add, can you please show how to refresh the page automatically
thanks
November 12th, 2011 at 5:38 pm
Has9, my apologies for the delay in responding. The command should work, but make sure the IP addresses are unique. This article and the MRTG page on cfgmaker both have some examples that may be of help.
Once MRTG is started the page should refresh automatically every five minutes; however, this can be modified by changing the value assigned to the global configuration option Interval from 5 to some other value.
November 30th, 2011 at 2:29 pm
Hi iceflatline..
Thanks for this helpful article..i really admired your hard work in writing it..
I have some basic questions to ask..do we have to install first the SNMP & HTTP before proceed with this MRTG tutorial? Do you have any good links to work it on?..since i already stumble upon different version of configuration on the internet but does know which one to choose..
Thanks in advance =)
December 1st, 2011 at 11:42 am
wale89, thank you. You do need to have the SNMP process already up and running in your router, or whatever device you happen to be interested in acquire data from, else the cfgmaker command will return an error. You should also have an http server installed before running the indexmaker command.
I’m not aware of any links you could simply point your MRTG implementation to.
December 14th, 2011 at 6:25 pm
Greetings from Finland and thank you for great HOWTO. Helped me and a few friends a lot. :)
December 15th, 2011 at 10:49 am
Thanks guys, for the simple how to guide!!
December 15th, 2011 at 11:43 pm
Mikko, Suhail, thank you kindly for your comments.
December 16th, 2011 at 10:47 am
Hey iceflatline,
just performed a test (ubuntu) and a production (debian) install following your tutorial: everything went veeery smooth.
Supercool, thanks a ton!
I’ve only added a very simple timer contdown (abt. 5 lines) to the page, which I believe would be a useful feature for indexmaker to have.
Cheers,
rash*
December 18th, 2011 at 10:19 am
rashmani, awesome. Glad it worked well for you. The countdown timer does sound useful. Would you mind posting the code when time permits? Thanks!
January 7th, 2012 at 7:34 am
Dear iceflatline,
i installed and configure as it is in tutorial but my graph was not updating showing 17mbps and was not updatingg,,, any sugetions
January 7th, 2012 at 1:44 pm
bhargavi, I’m not sure. Assuming you’ve followed the instructions correctly, it should update every 5 minutes. I would suggest going back over the instructions making sure each step is followed. I’ve installed MRTG many times as described and it has not failed to work.
January 23rd, 2012 at 8:02 am
Hello. Thanks for the excellent guide. When using your startup script I get the following:
root@apollo:/etc/init.d# update-rc.d mrtg defaults
update-rc.d: warning: /etc/init.d/mrtg missing LSB keyword ‘required-start’
update-rc.d: warning: /etc/init.d/mrtg missing LSB keyword ‘required-stop’
update-rc.d: warning: /etc/init.d/mrtg missing LSB keyword ‘default-start’
update-rc.d: warning: /etc/init.d/mrtg missing LSB keyword ‘default-stop’
Adding system startup for /etc/init.d/mrtg …
/etc/rc0.d/K20mrtg -> ../init.d/mrtg
/etc/rc1.d/K20mrtg -> ../init.d/mrtg
/etc/rc6.d/K20mrtg -> ../init.d/mrtg
/etc/rc2.d/S20mrtg -> ../init.d/mrtg
/etc/rc3.d/S20mrtg -> ../init.d/mrtg
/etc/rc4.d/S20mrtg -> ../init.d/mrtg
/etc/rc5.d/S20mrtg -> ../init.d/mrtg
root@apollo:/etc/init.d# /etc/init.d/mrtg status
/etc/init.d/mrtg: 73: Syntax error: word unexpected
Any thoughts? (Ubuntu 10.04.3 LTS )
January 23rd, 2012 at 11:23 am
Andrew: It appears you’ve got something wrong with the script you’re using to start/stop/restart MRTG. If you’re using the one provided in the post it should work as is – I’ve used it many times. If you’ve modified it or are using something else, I would suggest going back over it to make sure it’s coded correctly.
January 24th, 2012 at 8:14 am
Ice – I found the problem… a few lines concatenated at the end instead of needed line breaks. However, once that’s fixed, trying to start mrtg via the script gives me a permission denied. The script is owned by root, executable, and the mrtg binary is owned by root. I can start it just fine without the script with “env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg –logging /var/log/mrtg.log”.
January 24th, 2012 at 8:24 am
I’ll do more checking, I have a feeling there be other problems in copying the file… thanks again for the article.
January 24th, 2012 at 8:38 am
Success. Your script is fine, but need to be careful that it is copied correctly.
January 25th, 2012 at 11:03 am
Andrew: Thanks for your kind comments and taking the time to post. I’m glad it’s working for you.