lib/riemann/babbler/plugins/disk.rb in riemann-babbler-2.5.7 vs lib/riemann/babbler/plugins/disk.rb in riemann-babbler-2.5.8

- old
+ new

@@ -14,10 +14,11 @@ def init plugin.set_default(:service, 'disk') plugin.states.set_default(:warning, 70) plugin.states.set_default(:critical, 85) + plugin.states.set_default(:check_fstab, true) end def get_fstab fstab = File.read('/etc/fstab').split("\n").delete_if { |x| x.strip.match(/^#/) } fstab.join("\n") @@ -66,10 +67,10 @@ disk << { :service => plugin.service + " #{human_point} abs free", :description => "Disk free #{point}, B", :metric => point_stat.blocks_free * point_stat.block_size, :state => 'ok' } disk << { :service => plugin.service + " #{human_point} abs total", :description => "Disk space #{point}, B", :metric => point_stat.blocks * point_stat.block_size, :state => 'ok' } end get_monit_points_for_fstab.each do |point| disk << { :service => plugin.service + " #{point} fstab entry", :description => "Mount point #{point} not matched in /etc/fstab", :state => 'critical' } unless fstab.match(/#{point}(\s|\/\s)/) - end + end if plugin.check_fstab disk end end