diff options
author | Sean Horn <furikake1+github@gmail.com> | 2017-10-12 17:54:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-12 17:54:55 -0400 |
commit | a3aa051490d2b0784819735ea2e11dab0bbc8363 (patch) | |
tree | bfc46effc225ecfbdb658d9f6acaa746c8aea88c | |
parent | aee8f652943a8365b08ecf23f89180de55044e50 (diff) | |
download | ohai-sh/fix-uptime-seconds.tar.gz |
uptime_seconds and uptime should match on AIXsh/fix-uptime-seconds
On a given AIX system, the uptime_seconds and uptime do not match.
uptime_seconds in this case should be 4630366, not 1503190745
uptime_seconds: 1503190745
uptime: 53 days 14 hours 12 minutes 46 seconds
Therefore, our uptime_seconds is actually just the elapsed seconds on AIX, not the current time minus the elapsed seconds.
-rw-r--r-- | lib/ohai/plugins/aix/uptime.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ohai/plugins/aix/uptime.rb b/lib/ohai/plugins/aix/uptime.rb index 8adc78d0..9b295b9d 100644 --- a/lib/ohai/plugins/aix/uptime.rb +++ b/lib/ohai/plugins/aix/uptime.rb @@ -46,7 +46,7 @@ Ohai.plugin(:Uptime) do end elapsed_seconds = ((d.to_i * 86400) + (h.to_i * 3600) + (m.to_i * 60) + s.to_i) - uptime_seconds Time.now.to_i - elapsed_seconds + uptime_seconds elapsed_seconds uptime seconds_to_human(elapsed_seconds) end end |