2

I have this output via ifconfig:

user@host:~$ ifconfig eth0 | grep bytes
          RX bytes:999249172034 (999.2 GB)  TX bytes:33403577196 (33.4 GB)

The host has 7 days uptime.

Are the RX bytes and TX bytes counted since the host has been up, or over the lifetime of the host, and the value just "wraps" around when the value gets too big?

1 Answer 1

3

Over the lifetime of the interface, as far as I can tell. That is, if the interface goes away, like if you unload the driver module, the counters will be zeroed when you add it back. (Probably the same if you unplug and reconnect a USB interface, but I didn't test that.) Restarting the system would also reset them, yes.

As far as I can see, there's no way to explicitly clear the counters: a quick search resulted in multiple suggestions to unload and reload the driver in question, and that was pretty much the only suggestion there was.

That's not entirely odd though, since the counters are mostly used so that software monitoring them stores the last value it saw, and calculates the difference when it fetches the value the next time, never really looking at the absolute value. This means that even if there have been errors in the past, a proper monitoring solution will automatically ignore them, but restarts can still cause glitches if the monitor doesn't take the reset into account.

(Managed switches usually allow clearing the counters at least for display purposes, but might not clear the actual data so that monitoring software still works. E.g., as I recall, on HP switches clearing the counters on the command line only clears them for the current session. Disconnecting and logging back in shows the raw values again.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .