[nsp] ATM per VC stats via SNMP

Ed Ravin eravin at panix.com
Wed Feb 26 21:58:02 EST 2003


On Wed, Feb 26, 2003 at 04:42:02PM -0500, Charles Sprickman wrote:

> Can I ask something of you folks that's a bit OT?  I'm looking to build a
> quick tool that would look something like this:
> 
> spork$ ./showrate.pl 0 149
> *checking 30 second usage on pvc 0/149
> (30 seconds pass)
> *30 second usage on pvc 0/149: 180KB/s in, 50KB/s out
> spork$

That's a neat idea, wish I'd thought of that!

> Now I understand the basics here, take a sample, note the time, take
> another sample, note the time, do some math to work down to bytes/second.
> If I wanted to get a multi-sample quick test, like sample every 2 seconds,
> run the test for 15 seconds, can perl handle the timing requirements?

Sure it can, though you'll probably want the Time::HiRes module to get
sleep resolutions below 1 second.  If you're fetching the data via SNMP,
you have your pick of SNMP perl interfaces to use as well.

Drifting even further off topic, I recall seeing a presentation at LISA
2001 of an SNMP scripting language that looked very nifty and might be
a good language to use for writing stuff like this, or otherwise digging
interesting stuff out of your router that the normal tools don't know how
to do.  Hold on a minute, let me look at Usenix's site...  aha, here it is:

   http://www.usenix.org/events/lisa2001/tech/full_papers/schoenwaelder/schoenwaelder_html/indexold.html

It's called "scli" (for "SNMP command line interface") and the project page
is at:

   http://www.ibr.cs.tu-bs.de/projects/scli/doc.html

	-- Ed


More information about the cisco-nsp mailing list