HTTP-404 has asked for the wisdom of the Perl Monks concerning the following question:

Hello guys I have been crawling around perlmonks to find out how to get current server bandwidth via snmp, but the posts looked really scary to me i have installed Net::SNMP module, but i can't figure out from docs how can i simply display current server In speed in Kpbs or Mbps or what ever, and current Out speed Thank You very much

Replies are listed 'Best First'.
Re: Getting server Bandwidth
by dondelelcaro (Monk) on Sep 30, 2001 at 01:45 UTC
    If you are trying to get speed information on remote servers, you need to be running an snmp daemon, probably from the net-snmp package.Then you basically pull ifInOctects and ifOutOctets from the remote server and compare it to the previous value.

    If you are doing it on a local server you basically pull and parse /proc/net/netstat and then compare it to a previous value. Somewhere around I have a copy of the code that generates the bandwidth meter on kernel.org, and I could dig it up if you are interested.
Re: Getting server Bandwidth
by echo (Pilgrim) on Sep 30, 2001 at 05:23 UTC
    Have a look at MRTG, the Multi Router Traffic Grapher. Does nice graphs, and you can plug in your own perl script to monitor just about anything.