Click to See Complete Forum and Search --> : Clearing TX and RX packets in ifconfig


AK_Dude
12-26-2005, 01:03 AM
Short of turning an interface down and bringing it back up, does anyone know of a way to clear the TX/RX packets displayed by the ifconfig command?

I'm trying to write a set of scripts to use with rrdtool so I can monitor input and output packets on my Linux machines, and it would be helpful if I could clear the counters periodically (like at midnight). Unfortunately, I didn't see any way to clear the counters with "man ifconfig", nor did anything in "SEE ALSO" look promising. :confused:

I suppose if I had to, I could store the total packets in a flat text file, then at each sample interval, I could subtract this stored data point from the current value pulled from ifconfig, then store the difference (instead of total packets) in the RRD.

Anyways, if anyone has any idea how to clear the counters, I'd appreciate it!

happybunny
12-26-2005, 10:16 PM
two thoughts come to mind....ethtool and mii-tool...but you'd have to check on their powers your self.

AK_Dude
01-03-2006, 04:31 PM
I'll take a look at them--thanks!