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