bin/deputy in deputy-0.1.44 vs bin/deputy in deputy-0.1.45
- old
+ new
@@ -2,10 +2,12 @@
require 'rubygems'
require 'optparse'
$LOAD_PATH << "#{File.dirname(__FILE__)}/../lib"
require 'deputy'
+options = {}
+
OptionParser.new do |opts|
opts.banner = <<BANNER
Report to the sheriff
Usage:
@@ -21,14 +23,17 @@
opts.on('--run-plugins','Run all plugins for this minute (belongs into crontask)') do
puts Time.now.strftime("%Y-%m-%d %H:%M:%S")
Deputy.run_plugins
exit
end
+ opts.on('--host x', 'Use this host, when reporting') do |host|
+ options[:host] = host
+ end
end.parse!
-
+
metric, value = ARGV[0..1]
if metric.to_s.empty?
puts "Usage instructions: deputy --help"
exit
end
-Deputy.send_report metric, (value || Deputy::DEFAULT_VALUE)
+Deputy.send_report metric, (value || Deputy::DEFAULT_VALUE), options
\ No newline at end of file