简单的方法查看bond0流量
while true; do export `ifconfig bond0 | grep packets | awk '{print $5, $3}' | xargs echo | sed -E -e "s/([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)/rx=\1 rxp=\2 tx=\3 txp=\4/"` ; echo $rx $rxp $tx $txp `cat /tmp/netstat` | awk '{print $1-$5, $2-$6, $3-$7, $4-$8}';echo $rx $rxp $tx $txp > /tmp/netstat; sleep 5 ;done
简单的方法查看eno16780032流量
while true; do export `ifconfig eno16780032 | grep packets | awk '{print $5, $3}' | xargs echo | sed -E -e "s/([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)/rx=\1 rxp=\2 tx=\3 txp=\4/"` ; echo $rx $rxp $tx $txp `cat /tmp/netstat` | awk '{print $1-$5, $2-$6, $3-$7, $4-$8}';echo $rx $rxp $tx $txp > /tmp/netstat; sleep 5 ;done