Showing posts with label mrtg. Show all posts
Showing posts with label mrtg. Show all posts

Thursday, July 15, 2010

Common Questions About MRTG

SkyHi @ Thursday, July 15, 2010

What exactly am I looking at?



MRTG is a graphical representation of how much bandwidth your server
is using. The green graph represents the total traffic leaving your
server and entering our network. This traffic represents all of the
web pages, pictures, movies, etc on your server that your website
visitors are viewing. The more visitors you have viewing your
website, the more bandwidth you will use, and the bigger the green
graph of traffic will be. The blue line on the graph represents all
traffic coming in to you server. The graphs are read left ro right,
with the most recent traffic displayed on the right side of the graph.




What do the numbers on the graphs mean?



On the left side of the graph there will be a list of numbers that
represent the bandwidth usage. These numbers will have either a "k"
or an "M" next to it. The "k" stands for Kilobits/second of
bandwidth and the "M" stands for Megabits/second of
bandwidth. Servers with lower bandwidth usage will typically use
"Kilobits/second" while servers with higher bandwidth usage will use
"Megabits/second".


The numbers along the bottom edge of the graph show either the hour,
the day of the week, the last 4 weeks, or the months of the
year. These correspond to the Daily, Weekly, Monthly or Yearly MRTG stats.








What are the numbers below the graphs?



Below each Daily, Weekly, Monthly and Yearly graph are 6 sets of
numbers. These provide a quick way to reference what your traffic is
doing. The "Max" numbers indicate the peak bandwidth usage going in
and out of your server. The "Average" numbers show you the different
between the busiest time of your server and the slowest time of your
server. Lasty, the "Current" numbers show you how much bandwidth the
server was doing in the last 5 minutes.




Why does the "Average In" and/or "Average Out" numbers not match the
Metered 95% MRTG number?



The "Average" MRTG number is just that, an average of the bandwidth
usage for a given period of time. An "Average" does not show how
much bandwidth your server actually needed to meet peak demand of
visitors to your websites. The Metered 95% MRTG number is a much
better indication of how much bandwidth your server needed to satisfy
peak demand.




Why does the MRTG Green graph say "In" and the Blue line say "Out"
for my server?



To insure that we get an accurate measurement of bandwidth usage, we
record the traffic from the network switch your server is connected
to. This allows us to get a much more consistent measurement of your
traffic, since we do not need to worry about inconsistencies between
different operating system software and different network card
manufacturers. So the "Green In" graph represents traffic that is
going "Out" of your server and "In" to our network. Similarly, the
"Blue Out" represents traffic going "Out" of our network and "In" to
your server.




Why don't the stats in my AWstats, Wusage, Urchin or others like them
match the "Gigabyte Equivalent" listed on the MRTG page?



Log analyzers like the ones mentioned above only provide a sum total
of how many gigs of files were transferred in a certain period of
time, typically for a 24 hour period. They do not take into account
how much bandwidth your server actually needed to meet the peak
demand of visitors to your site. The Metered 95% MRTG measurement
represents how much bandwidth your server needed to meet the peak
demand of visitors to your site. (For websites that cater to North
American visitors, peak demand typically occurs in the evening
hours.) Also the MRTG stats show the total of traffic from your
server, so if you have multiple sites on your server, the MRTG stats
will include all of those together.




Am I billed for FTP traffic?



If you have customers downloading files via FTP, then yes that
bandwidth would be included in your monthly total for billing
purposes. If you only use FTP to upload files to your server, then
it would not have an effect on your monthly bandwidth usage.




I had a large spike in my traffic for a few hours, how is this going
to affect my bill?



With the Metered 95% MRTG, the top 5% of your traffic is discarded
when the 95% usage is calculated for the month. This 5% represents
about 36 hours of peak traffic out of every month that is excluded
from your monthly bill. So a large spike in traffic for a few hours
should not affect your bill. If you have a continually high traffic
over several days, or numerous spikes in traffic repeatedly over the
month, then yes it may affect your monthly bill. If you do see
abnormally high traffic spikes on your MRTG stats, please notify us
immediately. Large traffic spikes may be caused by password trading,
hotlinking or unauthorized use of your server.




Is there anything I can do to control the flow of bandwidth on my server?



Excessive bandwidth usage is usually due to visitors trading
passwords for member only areas or other unscrupulous webmasters
"hotlinking" images from your site. Programs such as Pennywize and
Proxypass can control bandwidth usage for websites with "members
only" areas. Simple tools just as Apache's "mod-rewrite" can control
hotlinking. In addition, upon request we can place a limit or "cap"
on how much bandwidth usage your server is allowed to use.




Bandwidth Capped aka "UnMetered Bandwidth"




If you have requested your server to have a bandwidth cap or throttle, you
should review your MRTG's regularly and contact us if an occurrence like
this happens. A flat top to the outgoing bandwidth like below shows your
site was slow and /or non responsive to users at that time. This is
undesirable and can effect your sales and popularity. We generally don't
suggest bandwidth capping or throttles for this reason. This is also known
as UnMetered hosting, it's the opposite of " Metered" which allows you to
use more when you need it.







I want an "Unmetered" hosting account, do you offer these?



Sure we can, but really this is a throttle or "Capped" segment which means
you are not able to go over a certain amount of bandwidth. When hosts say
they have "UnMetered" bandwidth, it just means they have put a limit on how
much bandwidth usage you can use.





What time zone is used for the MRTG stats?



The MRTG stats use the US Pacific time zone and are adjusted for
daylight savings time.






See Also:




http://en.wikipedia.org/wiki/Multi_Router_Traffic_Grapher

http://en.wikipedia.org/wiki/Burstable_billing
http://www.reliablehosting.com/mrtgquestions.htm

Tuesday, August 18, 2009

Centos Install and Configure MRTG

SkyHi @ Tuesday, August 18, 2009
How do I install and configure MRTG under Fedora Linux or CentOS Linux v5.x server to monitor the traffic load on network-links including routers?

The Multi Router Traffic Grapher (MRTG) is a tool to monitor the traffic load on network-links.

MRTG generates HTML pages containing PNG images which provide a LIVE visual representation of this traffic. You need the following packages:

* mrtg : Multi Router Traffic Grapher
* net-snmp and net-snmp-utils : SNMP (Simple Network Management Protocol) is a protocol used for network management. The NET-SNMP project includes various SNMP tools. net-snmp package contains the snmpd and snmptrapd daemons, documentation, etc. You also want to install the net-snmp-utils package, which contains NET-SNMP utilities.

This FAQ works with RHEL / CentOS and Fedora Linux.
Step # 1: Install MRTG

Type the following command to install packages using yum command under CentOS / Fedora Linux:
# yum install mrtg net-snmp net-snmp-utils
Step # 2: Configure snmpd

If you need to monitor localhost including interface and other stuff such as CPU, memory etc, configure snmpd. Open /etc/snmpd/snmpd.conf, enter:
# vi /etc/snmpd/snmpd.conf
Update it as follows to only allow access from localhost:

com2sec local localhost public
group MyRWGroup v1 local
group MyRWGroup v2c local
group MyRWGroup usm local
view all included .1 80
access MyRWGroup "" any noauth exact all all none
syslocation VSNL, India
syscontact Root

Save and close the file. Restart snmpd:
# chkconfig snmpd on
# service snmpd restart
Make sure you see interface IP, by running the following command:
# snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex
Sample Outputs:

IP-MIB::ipAdEntIfIndex.123.xx.yy.zzz = INTEGER: 2
IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1

Step # 3: Configure MRTG

Use cfgmaker command to creates /etc/mrtg/mrtg.cfg file, enter:
# cfgmaker --global 'WorkDir: /var/www/mrtg' --output /etc/mrtg/mrtg.cfg public@localhost

* --global 'WorkDir: /var/www/mrtg' : add global config entries i.e. set workdir to store MRTG graphs.
* --output /etc/mrtg/mrtg.cfg: configr output filename
* public@localhost : public is the community name of the device you want to create a configuration for. If you are using the wrong community name you will get no response from the device. localhost is the DNS name or the IP number of an SNMP-managable device i.e. our local server.

Finally, run indexmaker to create web pages which display the status of an array of mrtg interface status pages:
# indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg
Step # 4: Verify Cron Job

/etc/cron.d/mrtg runs mrtg command to monitor the traffic load on network links:
# cat /etc/cron.d/mrtg
Sample Output:

*/5 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok

Just make sure crond is running and you are done with configuration:
# chkconfig --list crond
If it is off in run level # 3, just run the following to turn on crond service:
# chkconfig crond on
# service crond on
How do I view mrtg graphs?

You need Apache web server to view graphs, simply type the following to install httpd:
# yum install httpd
# chkconfig httpd on
# service httpd on
Fire a webbrowser and type the url:
http://your-ip.add.ress/mrtg/
http://192.168.1.5/mrtg/
Fig.01:Sample MRTG Graph

Fig.01:Sample MRTG Graph
How Do I Create MRTG For My Router at 192.168.1.254?

Run cfgmaker as follows (there is no need to configure snmp for router, as most router and switches comes pre configured with their own SNMPD):
# cfgmaker --global 'WorkDir: /var/www/mrtg' --output /etc/mrtg/mrtg.cfg public@router
OR
# cfgmaker --global 'WorkDir: /var/www/mrtg' --output /etc/mrtg/mrtg.cfg public@192.168.1.254
How Do I Password Protect My Graphs?

Read this FAQ: Set Apache Password Protected Directories With .htaccess File.

reference: http://www.cyberciti.biz/faq/centos-fedora-linux-multi-router-traffic-grapher-tutorial/