lib/riemann/babbler/plugins/cpu.rb in riemann-babbler-0.4.8 vs lib/riemann/babbler/plugins/cpu.rb in riemann-babbler-0.4.9

- old
+ new

@@ -11,12 +11,14 @@ total = used + i2-i1 fraction = used.to_f / total end @old_cpu = [u2, n2, s2, i2] + + desc = "usage\n\n#{shell('ps -eo pcpu,pid,cmd | sort -nrb -k1 | head -10').chomp}" - if @old_cpu - { :service => plugin.service, :metric => fraction } + if fraction + { :service => plugin.service, :metric => fraction, :description => desc } else { :service => plugin.service, :state => 'ok' } end end