Sha256: 72ef63ba4dd2ef4d1ba8b6e0b28dd0b327016d7ab6c8d58f0c12c5c58b705a86

Contents?: true

Size: 280 Bytes

Versions: 3

Compression:

Stored size: 280 Bytes

Contents

collect(900) do
  next if not File.readable?('/proc/stat')
  File.open('/proc/stat') do |file|
    file.each do |line|
      next if not line =~ /^btime /
      boottime = Time.at(line.chomp.split[1].to_i)
      processor.event("os.reboot", 1, :now => boottime)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ganymed-0.3.4 lib/ganymed/collectors/uptime.rb
ganymed-0.3.3 lib/ganymed/collectors/uptime.rb
ganymed-0.3.2 lib/ganymed/collectors/uptime.rb