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