Documents
Howtos — MRTG
This document describes the procedure on how to install and configure MRTG to work with SNMP-enabled Cisco router.OS used: Linux (Fedora 9); tools used: mrtg, perl-IO-Socket-INET6, perl-SNMP_Session, perl-Socket6, and gd.
Configure Cisco's SNMP
-
Login to Cisco router and initiate script configuration via terminal by executing this:
# config t (hit enter key)
-
Configure Cisco router to enable its SNMP feature, by adding these entries to its configuration script:
snmp-server community muro RO
snmp-server community murw RW
- To add, at (config)# prompt type, type above entries and hit enter key, and then press CTRL+Z to finalize the configuration.
- At Cisco router# prompt, type: `reload' to apply new configuration
Prepare MRTG
-
Get and install mrtg and gd:
[1] Download the package at http://download.fedora.redhat.com/pub/fedora/linux/releases/9/Fedora/x86_64/os/Packages, and install it by executing:
# rpm -ivh mrtg-x.x.x.rpm \
perl-IO-Socket-INET6-x.x.x.rpm \
perl-SNMP_Session-x.x.x.rpm \
perl-Socket6-x.x.x.rpm; or
[2] If Fedora 9 DVD is present, install the package by executing these:
# mount /dev/cdrom /mnt
# rpm -ivh /mnt/Packages/mrtg-x.x.x.rpm
# rpm -ivh /mnt/Packages/gd-x.x.x.rpm; or
[3] If internet is available, do the easy way by executing this:
# yum install mrtg gd. -
Create /var/www/html/mrtg directory by executing these:
# mkdir /var/www/html/mrtg
# chown apache.apache /var/www/html/mrtg< -
Create /etc/mrtg/mrtg.cfg file by executing this command:
cfgmaker
--output=/etc/mrtg/mrtg.cfg \
--global "workdir: /var/www/html/mrtg" -ifref=ip \
--global 'options[_]: growright,bits' \
muro@router.mu.edu.ph -
If /etc/cron.d/mrtg is not present, edit /etc/crontab file and add these entries:
*/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
Restart crond service to make above setup in effect, by executing this:
# /etc/rc.d/init.d/crond restart
Initiate MRTG (for the first time)
-
To let MRTG create fresh graphs out from Cisco router network devices, execute this command:
`# env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg'
Check MRTG graphs
-
To check MRTG fresh graphs, open up web browser and type this address:
http://localhost/mrtg