Discussion:
Can I clear PPP counters?
(too old to reply)
Chris Nelson
2006-07-20 20:04:11 UTC
Permalink
Looking at pppstats/ppstats.h and include/linux/if_ppp.h in the pppd
distribution I don't see anyway to clear the packet and byte counters
for the link. What I find is that every time I connect, the packets
and bytes sent get added to the previous value of the counters. If I
want the packets sent or received since the link was last established,
how do I do that (other than by caching the first value I retrieve and
subtracting from every subsequent value).

Chris
Chris Nelson
2006-07-21 14:12:54 UTC
Permalink
Post by Chris Nelson
Looking at pppstats/ppstats.h and include/linux/if_ppp.h in the pppd
distribution I don't see anyway to clear the packet and byte counters
for the link. What I find is that every time I connect, the packets
and bytes sent get added to the previous value of the counters. If I
want the packets sent or received since the link was last established,
how do I do that (other than by caching the first value I retrieve and
subtracting from every subsequent value).
Some further research suggests that there is no way to clear the
counters and we may not really want to anyway. As it stands, the
counters for ppp0, etc. are consistent with eth0, etc. in that they are
not reset when the link goes up or down.
Pascal Hambourg
2006-07-21 16:00:13 UTC
Permalink
Hello,
Post by Chris Nelson
Some further research suggests that there is no way to clear the
counters and we may not really want to anyway. As it stands, the
counters for ppp0, etc. are consistent with eth0, etc. in that they are
not reset when the link goes up or down.
Are you talking about the counters displayed by ifconfig ?
On my system (Linux 2.4.32, pppd 2.4.1), obviously PPP interface
counters are reset each time the link goes down.
Chris Nelson
2006-07-21 20:56:24 UTC
Permalink
Post by Pascal Hambourg
Hello,
Post by Chris Nelson
Some further research suggests that there is no way to clear the
counters and we may not really want to anyway. As it stands, the
counters for ppp0, etc. are consistent with eth0, etc. in that they are
not reset when the link goes up or down.
Are you talking about the counters displayed by ifconfig ?
On my system (Linux 2.4.32, pppd 2.4.1), obviously PPP interface
counters are reset each time the link goes down.
No, the counters returned by pppstats.
Pascal Hambourg
2006-07-21 22:08:44 UTC
Permalink
Post by Chris Nelson
Post by Pascal Hambourg
Post by Chris Nelson
counters for ppp0, etc. are consistent with eth0, etc. in that they are
not reset when the link goes up or down.
Are you talking about the counters displayed by ifconfig ?
On my system (Linux 2.4.32, pppd 2.4.1), obviously PPP interface
counters are reset each time the link goes down.
No, the counters returned by pppstats.
On my system, they show the same values.

Loading...