Sha256: 03238e12684f730079587162639e1903452e53e35ee1f010cf7a0922cd590e84
Contents?: true
Size: 884 Bytes
Versions: 10
Compression:
Stored size: 884 Bytes
Contents
#!/usr/bin/env ruby # /dev/xvdi 2.9T 1.2T 1.7T 42% /ebs/stage-new require 'isna' reports = [] STDIN.each_line do |line| next if line =~ /Used/ chunks = line.chomp.split(/\s+/) hash = { } hash["Device"] = chunks[0] hash["Total Size"] = chunks[1] hash["Space Used"] = chunks[2] hash["Space Available"] = chunks[3] hash["Percentage Used"] = chunks[4] hash["Mount Point"] = chunks[5] reports << hash end reports.sort do |a, b| pna = a["Percentage Used"].scan(/\d+/)[0] pnb = b["Percentage Used"].scan(/\d+/)[0] pna.to_i <=> pnb.to_i end.reverse.each do |report| puts '' report.each do |key, value| puts "#{key.ljust(20).to_ansi.green.to_s}: #{value}" end pn = report["Percentage Used"].scan(/\d+/)[0] puts `echo #{pn} 100 | ix gauge` end puts '' # puts "Report generated on #{Time.now}"
Version data entries
10 entries across 10 versions & 1 rubygems