Sha256: 95d5265703b19e0e004cb1ab3507df0008a90351eac8034dde24179fda42346e

Contents?: true

Size: 536 Bytes

Versions: 3

Compression:

Stored size: 536 Bytes

Contents

require 'facter/util/uptime'

Facter.add(:uptime) do
    confine :operatingsystem => %w{Solaris Linux Fedora RedHat CentOS SuSE SLES Debian Ubuntu Gentoo AIX}
    setcode do
        Facter::Util::Uptime.get_uptime_simple
    end
end

if FileTest.exists?("/proc/uptime")
    uptime = Facter::Util::Uptime.get_uptime

    %w{days hours seconds}.each do |label|
        Facter.add("uptime_" + label) do
            setcode do
                Facter::Util::Uptime.get_uptime_period(uptime, label)
            end 
        end 
    end 
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facter-1.5.7 lib/facter/uptime.rb
facter-1.5.6 lib/facter/uptime.rb
facter-1.5.5 lib/facter/uptime.rb