A Perl Package for Monitoring Traffic
John Shearer
September 2001
Systems and network administrators constantly struggle to know what is happening
on their networks. This job is difficult at best, and at worst, it can be downright
exasperating. With the myriad of manufacturers, standards, protocols, and everyone
thinking they have the tool that does it all, the situation is not improving.
With this challenge in mind, I decided to turn to my old friends for help: Perl,
SNMP (Simple Network Management Protocol), CGI, and good old-fashioned HTML.
The rtr-graph package described in this article is a set of Perl scripts for
polling routers (or other SNMP-enabled devices) for information about traffic
in and out of specified interfaces. You can set up "rtr-traff"
as a cron job to poll the interface at a specified interval, then use a CGI
script for a Web front end to the finished graphs. The Web interface automatically
sorts results from different devices into separate drop-down lists. You can
also set up multiple config files to poll different devices, change final graph
specs, and set up new parameters. This concept was originally designed to check
our Internet T1 interface for traffic levels during the day. It has since evolved
into a versatile program that gathers statistics from any device to check problems,
get baselines, or just see what's going on.
Rtr-graph allows the administrator to quickly gain access to traffic statistics
in specific areas of the network. When trouble spots (or suspected trouble spots)
arise, rtr-graph can be quickly adjusted to monitor a certain area. The Web
interface allows the administrator to instantly view multiple graphs spanning
several days to see trends and set benchmarks (Figure
1).
|