There are many tools for network monitoring but you can do this with a simple bash script. #!/bin/bash time=”1″ # one second int=”eth0″ # network interface while true do txpkts_old=”`cat /sys/class/net/$int/statistics/tx_packets`” # sent packets rxpkts_old=”`cat /sys/class/net/$int/statistics/rx_packets`” # recv packets sleep $time txpkts_new=”`cat /sys/class/net/$int/statistics/tx_packets`” # sent packets rxpkts_new=”`cat /sys/class/net/$int/statistics/rx_packets`” # recv packets txpkts=”`expr $txpkts_new – $txpkts_old`”…
Where there is a shell, there is a way