Saturday 7 March 2009

MRTG (Multi Router Traffic Grapher)

Installation

MRTG (Multi Router Traffic Grapher) The Multi Router Traffic Grapher is a tool primarily used to monitor the traffic load on network links (typically by using SNMP). MRTG generates HTML pages containing PNG images which provide a LIVE visual representation of this traffic. MRTG typically produces daily, weekly, monthly, and yearly graphs. In addition to monitoring via SNMP, MRTG can also generate graphs based on the output of any application, allowing one to generate graphs of anything that needs monitoring (for example, CPU and memory usage, email volumes, web hits, etc).

1. Install package MRTG
#yum install mrtg

2. path folder mrtg
#/var/www/mrtg

3. add Allow from all
#vi /etc/httpd/conf.d/mrtg.conf

Alias /mrtg /var/www/mrtg

Order deny,allow
Deny from all
Allow from all
Allow from 127.0.0.1
#Allow from ::1
#Allow from .example.com


4. restart service http
#service httpd reload

5. sniff SNMP
#export LANG=en_US
#mkdir /var/www/mrtg/myhost
cfgmaker -global "options[_]:bits,growright" --global "workdir: /var/www/mrtg/myhost" public@myhost.domain > /etc/mrtg/mrtg-myhost.cfg

6. Run MRTG
#mrtg /etc/mrtg/mrtg-myhost.cfg

7. Create file index.html
#indexmaker --column=1 --output=/var/www/mrtg/myhost/index.html /etc/mrtg/mrtg-myhost.cfg

8. create command to run MRTG every 5 miniute
#vi /etc/cron.d/mrtg-myhost

0-59/5 * * * * root /usr/bin/mrtg/etc/mrtg/mrtg-myhost.cfg


9. restart crond
#service crond reload

10. show MRTG http://mywebserver/mrtg/myhost

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Google Search