[tools] Added netstats script
This commit is contained in:
parent
03498d6125
commit
302c5a7b99
1 changed files with 7 additions and 0 deletions
7
tools/unix/generate_netstats.sh
Executable file
7
tools/unix/generate_netstats.sh
Executable 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))
|
Reference in a new issue