Subject: Re: CVS commit: src/sbin/ifconfig
To: Bill Studenmund <wrstuden@netbsd.org>
From: John Nemeth <jnemeth@victoria.tc.ca>
List: tech-misc
Date: 04/23/2003 04:03:29
On Jul 29,  3:25am, Bill Studenmund wrote:
} On Sat, 12 Apr 2003, Martin Husemann wrote:
} > On Sat, Apr 12, 2003 at 01:30:32PM -0700, Bill Studenmund wrote:
} > > > Havard Eidnes <he@netbsd.org> writes:
} > > > > If this does what I think it does (after browsing the code, I think it
} > > > > does), zeroing the packet statistics will break the monotonous
} > > > > increase of counters restriction imposed on SNMP agents
} > > So what do other *BSDs do? I figure we need to come up with a new
} > > read-stats ioctl that will get the monotonic value. What name(s) are in
} > > use now?
} >
} > Why bloat the kernel more instead of having the SNMP daemon take care of it?
} > Or root?
} 
} Because how can SNMP take care of it?
} 
} If you can come up with a workable alternative (even in concept), I'd like
} to hear it.

     The way I handle it in my scripts is to poll the device every five
minutes.  If a counter value is less then the preceeding counter value,
then I check to see if the preceeding value was within approximately
200,000,000 of the wrap point then I assumed that it wrapped;
otherwise, I assume that it was reset.  This heuristic might not be
completely according to the protocol spec, but I find that it works for
me and produces very accurate stats (there may be a bit of lossage when
a counter is reset, which I could reduce by polling more frequently).

}-- End of excerpt from Bill Studenmund