How to install MRTG under Linux |
|
|
| Written by axel | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
1. Introduction
MRTG (Multi Router Traffic Grapher) is an application that allows us to observe the traffic of a network. It generates html pages with graphs which are refreshed according to our network’s current state. Its source is written in Perl and C which means that it can be installed in every Operating System we like. We will also need SNMP daemon (Simple Network Management Protocol) which gives us information for a network. The following installation was accomplished under Linux and specifically Fedora Core 6. With some little changes it can be used and under other distros.
2. SNMP server 2.1 Installation Initially we install the packets needed for SNMP. Yum makes this job a lot easier. Next we make snmpd service to start automatically for the runlevels we want.
And we start the server.
We keep a backup of snmpd.conf just in case anything goes wrong
And do the follow changes:
with those
where 10.0.0.0/8 we put what our network is
with those
with this one
with those
with something like this
2.3 Check We restart the server to take affect of the notices
Now we should see something like that
Where 10.103.0.33 is your ip address.
3. MRTG
We again use yum
3.2 Configuration We create the folder in which our graphs and html pages will be kept
Here you should pay notice to --output /etc/mrtg/mrtg.cfg as long as to public@localhost. With this command we tell MRTG to create a configuration file with the name ‘mrtg.cfg’ for the traffic of our computer (localhost). Instead of localhost you may put the address of any computer you may monitor as long as it runs SNMP. Next we create our default index page
Next we have to configure apache for MRTG to work correctly. MRTG creates a file ‘mrtg.cfg’ under /etc/httpd/conf.d we contains all the necessary for Apache. We change it to contain the ips we want to have access to our MRTG graphs. Here I have added all my network.
3.3 Check We run the following command In case you get an error like this
you have to run the above command more than once till it runs without any error. This is normal.
Finally we open our browser and type
And by clicking on it something like this
There are daily, weekly, monthly and yearly graphs which aren’t shown in the screenshot. By changing the .cfg file we can alter the information displayed to what we just want. 4. Outroduction With the same way it is possible to add as many computers as we want and therefore have a general overview of our network. Enjoy! ;) Did you enjoy this article? Please share it!
Set as favorite
Share This
Email This
Hits: 29198 Trackback(0)
Comments (21)
![]()
Pennada Prabhu Kiran
said:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
LANG = en_US.UTF-8 I am not abel to run MRTG Error in Firefox "You don't have permission to access /mrtg/ on this server" can u please help me out |
|
|
report abuse
vote down
vote up
|
Joe
said:
| I followed these instructions - how can I allow for all to view these pages? I don't need to deny at all. Do I just simply state Allow all? | |
|
report abuse
vote down
vote up
|
axel
said:
|
Hey Joe. Just use this mrtg.cfg and you should be ok. Alias /mrtg /var/www/mrtg Order allow,deny Allow from all |
|
|
report abuse
vote down
vote up
|
beler
said:
|
try with this cfgmaker --global "workdir: /var/www/mrtg/html/mrtg" -ifref=ip --output /etc/mrtg/mrtg.cfg --global 'options[_]: growright,bits' public@localhost |
|
|
report abuse
vote down
vote up
|
Md. Zafar Al Masood
said:
|
Hi, I have also the problem in Fedora 8 "You don't have permission to access /mrtg/ on this server" I followed the comments.. nothing happens Then Just Change the line in mrtg.cfgђ under /etc/httpd/conf.d as follows: Alias /mrtg /var/www/mrtg Order allow,deny Allow from all Then restart httpd and find all the graphs in Mozilla firefox |
|
|
report abuse
vote down
vote up
|
Md. Zafar Al Masood
said:
|
Change the word "location" replace with "Directory" in mrtg.cfgђ under /etc/httpd/conf.d |
|
|
report abuse
vote down
vote up
|
Md. Zafar Al Masood
said:
| Could you help me how to configure more than two machine in the network mrtg? | |
|
report abuse
vote down
vote up
|
T. A. Sumesh
said:
|
I have installed mrtg but it giving following error. "Forbidden You don't have permission to access /mrtg/ on this server." I have tried all the solution suggested above. Can somebody help me to solve this |
|
|
report abuse
vote down
vote up
|
Dev
said:
|
Hi, How do I add more machines and more info; like system temperature, memory utilization etc to the mrtg? Any good tutorials or links with step by step appreciated. |
|
|
report abuse
vote down
vote up
|
Roberto Lezcano
said:
|
Your work in this guide is fantastic, this guide fix my live.... Thanks P.D. I'm speak espanish my ingles is bad... :-( |
|
|
report abuse
vote down
vote up
|
poswer
said:
|
Forbidden You don't have permission to access /mrtg/ on this server. Apache/2.2.11 (Fedora) Server at localhost Port 80 |
|
|
report abuse
vote down
vote up
|
poswer
said:
|
i gave http://localhost/mrtg could not show chart can you help me. MRTG Index Page MRTG Multi Router Traffic Grapher version 2.16.2 Tobias Oetiker and Dave Rand but http://10.0.0.0/mrtg and http://hostname/mrtg it show error page. "You don't have permission to access /mrtg on this server. Apache/2.2.11 (Fedora) Server at hostname Port 80 Forbidden You don't have permission to access /mrtg/ on this server. Apache/2.2.11 (Fedora) Server at 10.0.0.1 Port 80 help me. thanks |
|
|
report abuse
vote down
vote up
|
poswer
said:
|
hi, at this time I had difficulty, after install mrtg on fedora 11 mrtg can be run, the value of traffic is not showing the traffic chart does not appear. any one can show me the way..... thanks.. |
|
|
report abuse
vote down
vote up
|
FUAD
said:
|
This instruction is nice. I create default mrtg graph its ok but When I add new pc 0R device in mrtg graph they are not show... Index page is show but no graph and inner page is not create Please help me |
|
|
report abuse
vote down
vote up
|
| < Prev |
|---|







