diff --git a/bin/riemann-riak b/bin/riemann-riak index 2378ecce..59bbd7bf 100755 --- a/bin/riemann-riak +++ b/bin/riemann-riak @@ -27,8 +27,8 @@ class Riemann::Tools::Riak def initialize detect_features - - @httpstatus = true + + @httpstatus = true # What's going on here? --aphyr if begin @@ -59,7 +59,7 @@ class Riemann::Tools::Riak def detect_features @escript = true # Whether escript is present on this machine @riakadmin = true # Whether riak-admin is present - + if `which escript` =~ /^\s*$/ @escript = false end @@ -113,6 +113,34 @@ class Riemann::Tools::Riak end end + def check_transfers + str = if @riakadmin + `riak-admin transfers` + else + nil + end + + return if str.nil? + + if str =~ /'#{opts[:node_name]}' waiting to handoff (\d+) partitions/ + report( + :host => opts[:riak_host], + :service => 'riak transfers', + :state => 'critical', + :metric => $1.to_i, + :description => "waiting to handoff #{$1} partitions" + ) + else + report( + :host => opts[:riak_host], + :service => 'riak transfers', + :state => 'ok', + :metric => 0, + :description => "No pending transfers" + ) + end + end + def check_disk gb = `du -Ls #{opts[:data_dir]}`.split(/\s+/).first.to_i / (1024.0**2) report( @@ -294,6 +322,7 @@ class Riemann::Tools::Riak check_stats check_ring check_disk + check_transfers end end