[tools] Added netstats script

This commit is contained in:
Alex Zolotarev 2011-07-28 08:13:15 +03:00 committed by Alex Zolotarev
parent 03498d6125
commit 302c5a7b99

View file

@ -0,0 +1,7 @@
#!/bin/bash
RX_BYTES=`ifconfig eth0 | grep -o 'RX bytes:[0-9]*' | grep -o '[0-9]*'`
TX_BYTES=`ifconfig eth0 | grep -o 'TX bytes:[0-9]*' | grep -o '[0-9]*'`
ACTIVE_DOWNLOADS=`netstat -n | grep 'tcp.*:80 .*ESTABLISHED' | wc -l`
echo $ACTIVE_DOWNLOADS $RX_BYTES $TX_BYTES $(($RX_BYTES + $TX_BYTES))