Sha256: b7d6f6066cd749b9e2f86df3ed6f82e809a01f2a3482c26bdbadf53cfc6ce80f

Contents?: true

Size: 723 Bytes

Versions: 37

Compression:

Stored size: 723 Bytes

Contents

module Specinfra
  class HostInventory
    class Filesystem
      def self.get
        cmd = Specinfra.command.get(:get_inventory_filesystem)
        filesystem = {}
        Specinfra.backend.run_command(cmd).stdout.lines do |line|
          next if line =~ /^Filesystem\s+/
          if line =~ /^(.+?)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+\%)\s+(.+)$/
            device = $1
            filesystem[device] = {}
            filesystem[device]['kb_size'] = $2
            filesystem[device]['kb_used'] = $3
            filesystem[device]['kb_available'] = $4
            filesystem[device]['percent_used'] = $5
            filesystem[device]['mount'] = $6
          end
        end
        filesystem
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
specinfra-2.23.0 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.22.0 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.21.1 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.21.0 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.20.2 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.20.1 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.20.0 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.19.6 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.19.5 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.19.4 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.19.3 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.19.2 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.19.1 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.19.0 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.18.3 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.18.2 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.18.1 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.18.0 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.17.1 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.17.0 lib/specinfra/host_inventory/filesystem.rb