You should do what dave says, if it is a product that you are developing you
may want to keep the 'wait' period configurable. If there are a lot of such
devices you have to think about a database to store the information about
the nodes, their poll interval, what to poll for etc.
Hope you have considered all this. If your current query is specific to only
retreiving the value from the network element, i would suggest you go
through the sample code in the net-snmp distro. I remember this code was not
very easy to follow(circa net-snmpv5).
cheers,
bharat
On 1/15/07, Dave Shield <[EMAIL PROTECTED]> wrote:
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
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
-------------------------------------------------------------------------
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
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders