User avatar
cpcnw
Posts: 58
Joined: Thu Jan 05, 2012 5:36 pm
Location: NW UK
Contact: Website

Network Stats

Wed Sep 13, 2017 10:43 am

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 :)
If you don't know what you want, you end up with a lot you don't!

User avatar
cpcnw
Posts: 58
Joined: Thu Jan 05, 2012 5:36 pm
Location: NW UK
Contact: Website

Re: Network Stats

Wed Sep 13, 2017 10:54 am

I was just thinking...

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

Maybe that's my answer :)
If you don't know what you want, you end up with a lot you don't!

User avatar
rpdom
Posts: 11808
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK

Re: Network Stats

Wed Sep 13, 2017 10:58 am

Yes, the number of bytes and packets will increase between each command.

Return to “Arch”

Who is online

Users browsing this forum: No registered users and 1 guest