Sha256: ab4a32004fe22b2b4fbcf277ed7cab6bad5834e4399dc5f9bd0b3745b2b5f58c

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

#!/usr/bin/env ruby

$:.unshift File.expand_path("#{File.dirname(__FILE__)}/../lib")

require 'trollop'
require 'mongodb/graphite/agent'
require 'mongodb/graphite/agent/graphite_writer'

opts = Trollop::options do
  opt :mongodb_username, "MongoDB username", :type => :string
  opt :mongodb_host, "MongoDB host", :type => :string, :default => "localhost"
  opt :mongodb_post, "MongoDB port", :type => :int, :default => 27017
  opt :mongodb_password, "MongoDB password", :type => :string
  opt :graphite_host, "Graphite host", :type => :string
  opt :graphite_port, "Graphite port", :type => :string
  opt :graphite_metrics_prefix, "Graphite metrics prefix", :type => :string, :default => Socket.gethostname
  opt :dry_run, "Dry run", :type => :boolean, :default => false
  opt :verbose, "Verbose", :type => :boolean, :default => false
end

if opts[:dry_run]
  puts "\n\nWARNING!!! This is a dry run\n\n\n"
  sleep 1
end

Trollop::die :graphite_host, "(or --dry-run) must be specified" if (opts[:graphite_host].blank? and opts[:dry_run].blank?)

runner = Mongodb::Graphite::Agent::Runner.new(opts)
runner.run

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongodb-graphite-agent-0.1.4 bin/mongodb-graphite-agent.rb
mongodb-graphite-agent-0.1.3 bin/mongodb-graphite-agent.rb
mongodb-graphite-agent-0.1.2 bin/mongodb-graphite-agent.rb