lib/reporter/default/stats_disk.rb in onering-report-plugins-0.0.30 vs lib/reporter/default/stats_disk.rb in onering-report-plugins-0.0.31
- old
+ new
@@ -7,18 +7,23 @@
# mounts
#
mounts = {}
current_dev = nil
+ uuids = Hash[Dir["/dev/disk/by-uuid/*"].collect{|i|
+ [File.expand_path(File.readlink(i), File.dirname(i)), File.basename(i)]
+ }]
+
File.read("/etc/mtab").lines.each do |line|
dev,mount,fstype,flags,dump,pass = line.split(/\s+/)
mounts[dev] = {
:mount => mount,
:device => dev,
:filesystem => fstype,
- :flags => flags.split(/\s*,\s*/)
- }
+ :flags => flags.split(/\s*,\s*/),
+ :uuid => uuids[dev]
+ }.compact
end
# logical space utilization
Facter::Util::Resolution.exec("df 2> /dev/null").to_s.lines.each do |line|
next if line =~ /^Filesystem/