Skip to content

Tag: pps

Display packets per second on Linux

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`”…

© 2021 - Marian Amza. All rights reserved.
Powered by Wordpress & Debian