bin/riemann-riak in riemann-tools-0.1.1 vs bin/riemann-riak in riemann-tools-0.1.2
- old
+ new
@@ -13,10 +13,11 @@
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 :cookie, "Riak cookie to use", :default => "riak"
opt :get_50_warning, "FSM 50% get time warning threshold (ms)", :default => 1000
opt :put_50_warning, "FSM 50% put time warning threshold (ms)", :default => 1000
opt :get_95_warning, "FSM 95% get time warning threshold (ms)", :default => 2000
opt :put_95_warning, "FSM 95% put time warning threshold (ms)", :default => 2000
@@ -24,11 +25,11 @@
opt :put_99_warning, "FSM 99% put time warning threshold (ms)", :default => 10000
def initialize
@escript = true
@riakadmin = true
- @httpstats = true
+ @httpstatus = true
if `which escript` =~ /^\s*$/
@escript = false
end
@@ -43,9 +44,14 @@
end
rescue => e
@httpstatus = false
end
end
+ # we're going to override the emulator setting to allow users to
+ # dynamically input the cookie
+ # this is done only once - hopefully it doesn't get overridden.
+ ENV['ERL_AFLAGS'] = "-setcookie #{opts[:cookie]}"
+
end
def check_ring
if @escript
str = `#{File.expand_path(File.dirname(__FILE__))}/riemann-riak-ring #{opts[:node_name]}`.chomp