Sha256: bc6d515e5b0ec0eebe81a6a0bf0029ee7b0001a5a244209b887de453557d4c75

Contents?: true

Size: 713 Bytes

Versions: 38

Compression:

Stored size: 713 Bytes

Contents

module Specinfra
  class HostInventory
    class Filesystem < Base
      def get
        cmd = backend.command.get(:get_inventory_filesystem)
        filesystem = {}
        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

38 entries across 38 versions & 1 rubygems

Version Path
specinfra-2.36.0 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.35.1 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.35.0 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.34.9 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.34.8 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.34.7 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.34.6 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.34.5 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.34.4 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.34.3 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.34.2 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.34.1 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.34.0 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.33.1 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.33.0 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.32.0 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.31.1 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.31.0 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.30.4 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.30.3 lib/specinfra/host_inventory/filesystem.rb