lib/riemann/babbler/plugins/memory.rb in riemann-babbler-0.4.7 vs lib/riemann/babbler/plugins/memory.rb in riemann-babbler-0.4.8

- old
+ new

@@ -8,13 +8,15 @@ } free = m['MemFree'].to_i + m['Buffers'].to_i + m['Cached'].to_i total = m['MemTotal'].to_i fraction = 1 - (free.to_f / total) + desc = "usage\n\n#{shell('ps -eo pmem,pid,comm | sort -nrb -k1 | head -10').chomp}" + [ { :service => plugin.service, :metric => fraction }, - { :service => plugin.service + " free", :metric => free.to_f }, - { :service => plugin.service + " total", :metric => total.to_f} + { :service => plugin.service + " free", :metric => free.to_f, :state => 'ok', :description => desc }, + { :service => plugin.service + " total", :metric => total.to_f, :state => 'ok', :description => desc } ] end end