2015-02-23

Realtime bandwidth motinoring in one line

To get traffic RX/TX in Mb/s on Linux

IF=eth0 ;echo "RX\tTX" ; while true ; do A=$(awk "/$IF:/ {print \$2,\$10}" /proc/net/dev) && sleep 8 && B=$(awk "/$IF:/ {print \$2,\$10}" /proc/net/dev) && echo -n "$A $B" |awk '{print ($3 - $1)/2^20,($4 - $2)/2^20}';done

No comments:

Post a Comment

Popular posts