![]() Don't forget to change eth0 to network device you want to monitor. It will show you the average "received bytes per second" for period of 10 seconds (you can change period by changing S=10 parameter, and you can measure transmitted BPS instead of received BPS by using tx_bytes instead of rx_bytes). If you want just to get the value, you can use simple shell oneliner like this: S=10 F=/sys/class/net/eth0/statistics/rx_bytes X=`cat $F` sleep $S Y=`cat $F` BPS="$(((Y-X)/S))" echo $BPS TOTAL: 39.1MB 92.6Mb 92.6Mb 27.9Mb 15.6Mbĭon't forget about the classic and powerful sar and netstat utilities on older *nix! ![]() # Ttl: 2.49 GByteĪnother excellent tool is iftop, also easily apt-get'able: 191Mb 381Mb 572Mb 763Mb 954Mb Nload is a great tool for monitoring bandwidth in real time and easily installed in Ubuntu or Debian with sudo apt-get install nload. Local = just reads from /sys/class/net/$dev/statistics every second, and prints out the current numbers and the average rate of change: $. My $dir = "/sys/class/net/$dev/statistics" ![]() I wrote this dumb script a long time ago, it depends on nothing but Perl and Linux≥2.6: #!/usr/bin/perl No need for priv, dorky binaries, hacky scripts, libpcap, etc. Got sar? Likely yes if youre using RHEL/CentOS. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |