I'm trying to trace a possible link problem on one of our servers' ethernet interfaces. ifconfig reports a large number of error packets. I've asked the hosting company to make some changes to the setup and would like to reset the interface counters to get a better idea if the situation has improved.

Restarting the machine is the obvious answer, but as this machine is the primary NAS, a maintenance window will be hard to acquire. Is it possible to reset the counters without a restart of the machine ?

Operating system is RedHat EL4, 32bit.


This question has been answered on SF already.

In short, the only way on a Linux box (at present) is to reload the network driver module, which may or may not be possible with your kernel configuration.


Let me add a remark why resetting network counters is a bad idea: It only works with a single reader.

A single reader knows that it has reset the counter and is able to deal with it. But if there are many different readers (e.g. monitoring plugins, snmp agents, etc) only the one that resets knows about it. All others will only see a sudden jump of the counter. That's bad.

Therefore, it's a good idea to offer a differential mode in programs which display these numbers. I.e. display the difference between the last counter reading and the current reading instead of displaying the absolute value of the current reading. Using this technique there often is no need to reset the counter.


It sounds like you can't.

You could just restart the network service and reload the driver. This would not be a full reboot. But you would still need a maintenance window, and a console/kvm session so you could reload the service.


Am I missing something?

Isn't resetting the counters is just a cosmetic convenience in the situation you describe?

Say your tx errors are 100001 at the time the network change is made, then you simply treat 100001 as 0. I.e. if 30 minutes later there are 100030 tx errors shown, you know you've had 29 additional errors. I don't really see the advantage of resetting the counters, unless you anticipate they are going to overflow - even then it still just a convenience.

  • It may be "just a cosmetic convenience", but cosmetic conveniences are sometimes nice and sometimes necessary, as is confirmed by the barage of variants of the same question on the web. It's a bit like saying "it's cosmetic convenience to colour dangerous objects red": painting them red makes people use them better, making it important. – Tomislav Nakic-Alfirevic Jul 16 '19 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.