I noticed this while trying to track down a bug.
Is there any reason not to use -Ot and divide by 100 rather than parsing the string?
Use raw timeticks instead of parsing the string for sysUpTime and hrS…
Auto-Deploy finished, Test PR at http://3021.ci.librenms.org or https://3021.ci.librenms.org
Fun fact, this code is from the initial import and has been moved to 4 different files!
I'm not sure... I do recall somewhen that snmpd would overflow the integer at some point causing false uptime reports...
But again, not sure if it was related to ticks...
When an overflow happens that's where we switch where we get the uptime from. It still may not be perfect but it's worked so far.
Running this on my install at the mo with no issues so 👍 from me.
@f0o This change should not affect our handling of sysUptime overflows. I checked on a device that is approaching 4yrs uptime and it does indeed properly fall back to snmpEngineTime.0.
I also have been running with this on my production server without any issues.
Fair 👍 then :)
👍 from me - this has been on my list to change