Sha256: 0274299d16fa92ee5b7f7064cb55eec23f1f9808f9397ac1aaae24839e2edabf

Contents?: true

Size: 858 Bytes

Versions: 219

Compression:

Stored size: 858 Bytes

Contents

module Specinfra
  class HostInventory
    class Filesystem < Base
      def get
        cmd = backend.command.get(:get_inventory_filesystem)
        ret = backend.run_command(cmd)
        if ret.exit_status == 0
          parse(ret.stdout)
        else
          nil
        end
      end
      def parse(ret)
        filesystem = {}
        ret.each_line 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

219 entries across 219 versions & 3 rubygems

Version Path
specinfra-2.46.0 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.45.0 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.44.8 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.44.7 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.44.6 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.44.5 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.44.4 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.44.3 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.44.2 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.44.1 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.44.0 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.43.11 lib/specinfra/host_inventory/filesystem.rb
specinfra-cisco-2.40.2 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.43.10 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.43.9 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.43.8 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.43.7 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.43.6 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.43.5 lib/specinfra/host_inventory/filesystem.rb
specinfra-2.43.4 lib/specinfra/host_inventory/filesystem.rb