2

How can I calculate the network utilization in terms of bytes transfered over the network card on the basis of its maximum potential speed? I am looking for something in unix/perl for unix os.

bony
  • 21
  • 1
  • [here](http://stackoverflow.com/questions/5253396/how-do-i-collect-bandwidth-utilization-data-on-remote-devices-switches-servers/5340942#5340942) I answer the same question – JPBlanc Apr 09 '11 at 05:33

2 Answers2

1

try the net-snmp package which implements the snmp protocol. theres an option to embed perl.

net-snmp

With this you can communicate with network devices and prompt for specific data they store. This data is pretty much standard for most devices although you will also find manufacturer's specifics. an example request for bytes transfered trough a port would be something like:

snmpwalk -Os -c public -v 1 192.168.1.2 ifInOctets.2

which will tell you the number of bytes passed trough the interface 2 on the device with the given address (192.168.1.2)

Also you might wanna check this tool for traffic monitoring, which is perl implementation.

mrtg

Community
  • 1
  • 1
Sednus
  • 2,095
  • 1
  • 18
  • 35
  • Thanks Sednus. I will take a look into this. Hopefully the snmp perl package works on all the flavours of OS. – bony Feb 26 '11 at 04:42
1

Another option on linux can be to use the /proc filesystem http://www.linuxjournal.com/article/8381

MARK
  • 2,302
  • 4
  • 25
  • 44