| 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
Bookmark
Email This
Hits: 12360 Comments (10)
![]()
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
|
axel
said:
| Just in case, have you edited ‘mrtg.cfg’ under /etc/httpd/conf.d and added 127.0.0.1 next to allow? If so, have you restarted apache after making this change? | |
|
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
|
| < Prev |
|---|






