MRTG configurations


Setup the Device

cisco(config)# snmp-server community public RO

setup the MRTG server

yum install  mrtg  -> will install the MRTG
yum install httpd -> will install the apache to view the graphs crated by mrtg

To configure the MRTG issue following command:

Cfgmaker –global  “WorkDir: /var/www/mrtg” –output /etc/mrtg/mrtg.cfg  device-community- string@(hostname or IP)

in this command :

            --global  “WorkDir: /var/www/mrtg”  -> this is global configuration to define where the graphs will be store
- -output /etc/mrtg/mrtg.cfg   ->   this is the output file name
 device community  string->  Configured snmp name on the device. In this case it is ‘public’   as   configured under the cisco device
hostname or IP  ->  device IP or hostname



Now run the indexmaker, that will create web pages which display the status:

indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg

As next step you have to run following to gather the information and write into graphs:

LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_lock

Also you can automate the run of MRTG by adding this command to cron job as followed. It will run in every 5 minutes as scheduled.

*/5 * * * * *   LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_lock
 
 Now start the apache server to view graphs created by the MRTG:

Service httpd start
Chkconfig httpd on  -> run apache from the boot up of the server

Now you can browse the MRTG graphs by accessing:

http://IP-Address-Of-the-Apache-server/mrtg



Comments

Popular posts from this blog

ADSL configuration on Cisco router