parent
6725ca10ab
commit
f09290442c
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
# https://www.unixteacher.org/blog/linux/display-packets-per-second-on-linux/
|
||||
|
||||
time="1" # one second
|
||||
int="enp3s0f0" # 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/tx_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/tx_packets`" # recv packets
|
||||
txpkts="`expr $txpkts_new - $txpkts_old`" # evaluate expressions for sent packets
|
||||
rxpkts="`expr $rxpkts_new - $rxpkts_old`" # evaluate expressions for recv packets
|
||||
echo "tx $txpkts pkts/s - rx $rxpkts pkts/ on interface $int"
|
||||
done
|
@ -1 +1 @@
|
||||
Subproject commit fae914b11b8de423d3b11f7259db03cf6cdf3d21
|
||||
Subproject commit 4bcc820a8b316c177cc5d82ee5edbbe0ac551814
|
Loading…
Reference in new issue