[nsp] ATM per VC stats via SNMP

Iva Cabric ivac+cisco-nsp at mail.iskon.hr
Thu Feb 27 09:20:18 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$
> 
> 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?  My
> head is not working on "real time" vs. "program run time"...

snmpdelta (from net-snmp) can monitor values at specified period and
report them, for example:

snmpdelta -CT -Cs -Cp 10 -v2c some_router -c public interfaces.ifTable.ifEntry.ifInOctets.2

will print number of octets which entered interface with index 2,
together with timestamp. With awk or perl (or expr) you can divide that
number with period (10 seconds) and get kB/s (and multiply it with 8
bits if you need kb/s).



More information about the cisco-nsp mailing list