Sha256: 103673e0ffb052931a0c933d41b55c2ea83d6bfd5dbc157e6bf146cf9d777243

Contents?: true

Size: 832 Bytes

Versions: 5

Compression:

Stored size: 832 Bytes

Contents

#!/usr/bin/env ruby
require 'rubygems'
require 'optparse'
$LOAD_PATH << "#{File.dirname(__FILE__)}/../lib"
require 'deputy'

OptionParser.new do |opts|
  opts.banner = <<BANNER
Report to the sheriff

Usage:
    deputy System.metric value
    deputy [OPTION]

Options:
BANNER

  opts.on("-h", "--help","Show this.") { puts opts; exit }
  opts.on('-v', '--version','Show Version'){ puts Deputy::VERSION; exit}
  opts.on('--install-cron','Install crontask'){ Deputy.install_cron; exit}
  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
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)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
deputy-0.1.44 bin/deputy
deputy-0.1.43 bin/deputy
deputy-0.1.42 bin/deputy
deputy-0.1.41 bin/deputy
deputy-0.1.40 bin/deputy