Use raw timeticks instead of parsing the string for sysUpTime and hrSystemUptime #3021

Merged
merged 1 commit into from Feb 18, 2016

Projects

None yet

5 participants

@murrant
Contributor
murrant commented Feb 17, 2016

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?

@murrant murrant Use raw timeticks instead of parsing the string for sysUpTime and hrS…
…ystemUptime
9ccf16d
@murrant
Contributor
murrant commented Feb 17, 2016

Fun fact, this code is from the initial import and has been moved to 4 different files!

@f0o
Member
f0o commented Feb 17, 2016

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...

@laf
Member
laf commented Feb 17, 2016

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.

@murrant
Contributor
murrant commented Feb 17, 2016

@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.

@f0o
Member
f0o commented Feb 17, 2016

Fair 👍 then :)

@paulgear
Member

👍 from me - this has been on my list to change

@f0o f0o merged commit fbea6e2 into librenms:master Feb 18, 2016

2 checks passed

Auto-Deploy Build finished. No test results found.
Details
Scrutinizer No new issues
Details
@murrant murrant deleted the murrant:uptime_timeticks branch Feb 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment