On Sun, Nov 29, 2009 at 7:39 PM, Dave Shield <d.t.shi...@liverpool.ac.uk>wrote:

> 2009/11/29  <a...@lingnu.com>:
> > the issue could have been resolved by sampling the
> > system uptime when the snmp daemon starts, and using
> > it to calculate the sysUptime value, instead of relaying
> > on the system clock
>
> But the value of system uptime when the agent starts is 0,
> by definition.
>
> The SNMP agent needs to relate this point to future
> timestamps, and does so by using the local clock.
>
> Yes - if that clock time changes, you've got a problem.
>

Computing the system uptime via gettimeofday() is wrong. A better solution
would be to let get_uptime() in snmplib/system.c compute the system uptime
using methods that do not depend on the wall clock time,  e.g.
clock_gettime(CLOCK_MONOTONIC) on POSIX systems that support monotonic
clocks or GetTickCount() on Windows systems. Note: the clock rate of
CLOCK_MONOTONIC takes the clock drift computed by the NTP algorithm in
account, while GetTickCount() does not.

Bart.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to