bin/riemann-riak in riemann-tools-0.0.5 vs bin/riemann-riak in riemann-tools-0.0.6
- old
+ new
@@ -8,11 +8,12 @@
require 'yajl/json_gem'
class Riemann::Tools::Riak
include Riemann::Tools
- opt :riak_host, "Riak host", :default => "localhost"
+ opt :riak_host, "Riak host", :default => Socket.gethostname
+ opt :data_dir, "Riak data directory", :default => '/var/lib/riak'
opt :stats_port, "Riak HTTP port for stats", :default => 8098
opt :stats_path, "Riak HTTP stats path", :default => '/stats'
opt :node_name, "Riak erlang node name", :default => "riak@#{Socket.gethostname}"
opt :get_50_warning, "FSM 50% get time warning threshold (ms)", :default => 1000
@@ -71,10 +72,10 @@
)
end
end
def check_disk
- gb = `du -s /var/lib/riak`.split(/\s+/).first.to_i / (1024.0**2)
+ gb = `du -s #{opts[:data_dir]}`.split(/\s+/).first.to_i / (1024.0**2)
report(
:host => opts[:riak_host],
:service => 'riak disk',
:state => 'ok',
:metric => gb,