Can I clear PPP counters? - PPP

This is a discussion on Can I clear PPP counters? - PPP ; 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 ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Can I clear PPP counters?

  1. Can I clear PPP counters?

    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


  2. Re: Can I clear PPP counters?

    Chris Nelson wrote:
    > 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.


  3. Re: Can I clear PPP counters?

    Hello,

    Chris Nelson a écrit :
    >
    > 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.

  4. Re: Can I clear PPP counters?

    Pascal Hambourg wrote:
    > Hello,
    >
    > Chris Nelson a écrit :
    > >
    > > 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.


  5. Re: Can I clear PPP counters?

    Chris Nelson a écrit :
    >>
    >>>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.

+ Reply to Thread