Magnus & Stewart,
Thanks for the suggestion of hrSystemUptime
- I'm not going to switch to that because I'm not sure I want to expose
the entire HR mib, and I don't have the time to implement anything
else.
I can also justify this to myself as follows, but I don't expect you to be
convinced by this!
It
all comes down to how you define the "network management portion of the
system". In an embedded system such as the one I'm working on, the
whole CPU subsystem and the software loaded on it is for management
only, so I feel justified in identifying the "network management portion
of the system" with the operating system and all the software, rather
than just "snmpd". And we've no desire to expose to users what
different daemons are running on the system - they see it as just a
black box.
> By the way, what will happen when your device have been up for 497 days?
> (TimeTicks overflows at that time)
Good
point, but it looks like the same is true of hrSystemUptime, and it
will be true of SysUptime even if you base it on the Snmpd uptime.
> I have to admit I am somewhat surprised to not find any systemBootTime
> that tells, as a DateAndTime string, when the system was last booted.
Personally I'd also like a numeric value (with longer wrap period) as it makes
the calculations easier!
Mike.
> Subject: Re: sysUpTime discrepancy
> From: ma...@lysator.liu.se
> To: mjvm...@hotmail.com
> CC: net-snmp-coders@lists.sourceforge.net
> Date: Thu, 19 Sep 2013 22:34:02 +0200
>
> On Thu, 2013-09-19 at 07:56 +0100, Mike Moreton wrote:
> > On Fri, 2013-09-13 at 20:46 +0000, Andy Cress wrote:
> > > Folks,
> > >
> > > Currently net-snmp measures sysUpTime relative to when the snmpd
> > > starts, and perhaps that is often the same as the overall system
> > > uptime, but in some systems, the services could be restarted without
> > > rebooting, so I am proposing that the sysUpTime should be measured
> > > against the /proc/uptime or /usr/bin/uptime value instead. The daemon
> > > could read this at init time.
> >
> > I recently came across this problem on an embedded system where I was
> > restarting the daemon in the (extremely rare) event that I needed to
> > change an account password. Suddenly my "reboot" detection triggered
> > because sysUptime had gone backwards.
> >
> > I could see various solutions to this problem:
> >
> > 1) Use the MIB based authentication configuration, but this wasn't an option
> > for me as we didn't want that enabled in the system.
> > 2) Find some other way of re-configuring snmpd without restarting. Well
> > I failed on that one.
> > 3) Find some other, more appropriate object to use for reboot detection.
> > Again I failed.
>
> hrSystemUptime?
>
> DESCRIPTION
> "The amount of time since this host was last
> initialized. Note that this is different from
> sysUpTime in the SNMPv2-MIB [RFC1907] because
> sysUpTime is the uptime of the network management
> portion of the system."
>
>
> > 4) Patch snmpd to use the system uptime.
> >
> > I ended up doing the latter, even though I don't believe it's strictly
> > correct
> > (see patch below). I wonder if this could be put in inside #ifdefs for we
> > strange people who prefer the non-correct operation?
> >
>
> given the existance of hrSystemUptime I think it would be a bad idea.
>
> By the way, what will happen when your device have been up for 497 days?
> (TimeTicks overflows at that time)
>
> I have to admit I am somewhat surprised to not find any systemBootTime
> that tells, as a DateAndTime string, when the system was last booted.
>
> /MF
>
>
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders