![]() Author: Ruwan Jayasinghe <rjayasin**lausd.k12.ca.us> Contributor: Darrell May, Placido Sanchez, and Dan York. Release supported: RH73 License: GPL Last updated: October 9, 2003 |
|
Problem:
You want to monitor traffic patterns of individual ports on Cisco Switches/Routers
on your network.
Solution: By installing the *MRTG RPM* and following the procedure here, you will wind up with a directory that graphically displays traffic statistics such as, input/output per switch port in bps sampled/averaged every 5mins and graphed, hourly, daily, weekly and yearly for each of your Cisco switches and routers. For more information about MRTG or to see examples of the output, visit the MRTG Home Page. This may work on other "manageable" switches/routers if they support SNMP. An example graph of weekday traffic: |
STEP 1:
Download and install the rpm
Download MRTG RPM Here Or
Then install rpm by,
Or with a recent version of RPM,
download and install simultaneously using,
|
STEP 2:
create a directory in /var/www/html named "mrtg"
(cgi permissions not needed, just read access ) [root@localhost]# mkdir -p /var/www/html/mrtg |
STEP 3:
copy/paste the shell script below, name it "create-mrtg" and save in /root. Or get from here.
#!/bin/bash
#create the cfg file for this Ip
address using the first variable (assumes community string is "public")
#Create an index.html file for this
folder using the first variable
#create an entry in script "all-ip"
to run mrtg for each device.
#Uncommenting the line below will
create a "master" index.html inside the /var/www/html
#echo "<br><a href=$1/index.html>
MRTG of Device $1 </a>" >> /var/www/html/mrtg/index.html
|
STEP 4:
Make the create-mrtg script executable by,
[root@localhost]# chmod 755 create-mrtg |
STEP 5:
Now run create-mrtg
Arg1 Arg2 | | EX: [root@localhost /root]# ./create-mrtg IDF1SW1 10.0.0.1
|
STEP 6:
Now run these commands once from the root prompt,
[root@localhost /root]# chmod 755 /etc/mrtg/all-ip [root@localhost /root]# echo
"0-59/5 * * * * root /etc/mrtg/all-ip" >> /etc/crontab
|
STEP 7:
Now wait a few minutes (20 or so) and try
EX: http://your.server.ip/mrtg/IDF1SW1 |
Notes:
|
|