On 08/01/07, Peeyush Bishnoi <[EMAIL PROTECTED]> wrote:
>  Can any tell me how to calculate the bandwidth of a network link
> using SNMP in c/c++ .

Retrieve the value of 'ifInOctets' and/or 'ifOutOctets' for the interface
in question.   Then wait a bit, and retrieve the same values again.
The difference between the two readings (divided by the time between
the readings) will give you the rate of data transfer for this interface.

Comparing this against 'ifSpeed' for that interface should show how
busy the interface is.

Dave

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to