Page 1 of 1

Network Stats

Posted: Wed Sep 13, 2017 10:43 am
by cpcnw
What is the most reliable way to get eth0 stats? I am a bit confused about the disparity between the following...

Code: Select all

# cat /proc/net/dev

           bytes    packets
eth0:  699814    5578

# cat /sys/class/net/eth0/statistics/rx_packets
5598

# ifconfig
eth0: RX packets 5623  bytes 703775 (687.2 KiB)
Thanks :)

Re: Network Stats

Posted: Wed Sep 13, 2017 10:54 am
by cpcnw
I was just thinking...

Each time I executed these commands I was doing so over SSH

Maybe that's my answer :)

Re: Network Stats

Posted: Wed Sep 13, 2017 10:58 am
by rpdom
Yes, the number of bytes and packets will increase between each command.