lib/riemann/babbler/plugins/disk.rb in riemann-babbler-0.1.3 vs lib/riemann/babbler/plugins/disk.rb in riemann-babbler-0.1.4
- old
+ new
@@ -26,11 +26,12 @@
monit_points << mtab[1] unless NOT_MONITORING_FS.include? mtab[2]
end
disk = Hash.new
monit_points.each do |point|
point_stat = Filesystem.stat point
- disk.merge!({point + " storage" => (point_stat.blocks_free/point_stat.blocks_available)})
- disk.merge!({point + " inode" => (point_stat.files_free/point_stat.files_available)})
+ human_point = point == "/" ? "/root" : point
+ disk.merge!({human_point + " block" => 1 - point_stat.blocks_available.to_f/point_stat.blocks})
+ disk.merge!({human_point + " inode" => 1 - point_stat.files_available.to_f/point_stat.files})
end
disk
end
def tick