Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: c9836cff2c
Fetching contributors…

Cannot retrieve contributors at this time

executable file 98 lines (78 sloc) 2.668 kB
#!/var/vcap/bosh/bin/ruby
#
# Copyright (c) 2009-2012 VMware, Inc.
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
require "rubygems"
require "bundler/setup"
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")))
require "agent"
# Defaults
options = {
"configure" => false,
"logging" => { "level" => "DEBUG" },
"mbus" => "nats://localhost:4222",
"agent_id" => "not_configured",
"blobstore_options" => {},
"blobstore_provider" => "simple",
"infrastructure_name" => "vsphere",
"platform_name" => "ubuntu",
"base_dir" => "/var/vcap",
"smtp_port" => 2825,
"process_alerts" => true,
"heartbeat_interval" => 60
}
opts = OptionParser.new do |opts|
opts.on("-c", "--configure", "Invoke") do |opt|
options["configure"] = true
end
opts.on("-a", "--agent_id String", "Agent ID") do |opt|
options["agent_id"] = opt
end
opts.on("-b", "--base_dir String", "Base directory") do |opt|
options["base_dir"] = opt
end
opts.on("-l", "--log_level String", "Log level") do |opt|
options["logging"] = { "level" => opt }
end
opts.on("-n", "--nats String", "Nats/mbus (nats://user:pass@host:port)") do |opt|
options["mbus"] = opt
end
opts.on("-p", "--provider String", "Blobstore provider") do |opt|
options["blobstore_provider"] = opt
end
opts.on("-I", "--infrastructure String", "Infrastructure") do |opt|
options["infrastructure_name"] = opt
end
opts.on("-P", "--platform String", "Platform") do |opt|
options["platform_name"] = opt
end
opts.on("-r", "--root_dir String", "Root directory") do |opt|
options["root_dir"] = opt
end
opts.on("-t", "--smtp-port Integer", "Built-in SMTP server port") do |opt|
options["smtp_port"] = opt
end
opts.on("--no-alerts", "Don't process alerts from Monit") do |opt|
options["process_alerts"] = false
end
opts.on("-h", "--heartbeat-interval Integer", "Heartbeat interval") do |opt|
options["heartbeat_interval"] = opt
end
opts.on("-s", "--blobstore String", "Blobstore options") do |opt|
if opt =~ /@/
credentials, endpoint = opt.split("@", 2)
user, password = credentials.split(":", 2)
options["blobstore_options"].merge!("user" => user, "password" => password)
else
endpoint = opt
end
# check if endpoint seems like a local path
if endpoint =~ /^\//
options["blobstore_options"]["blobstore_path"] = endpoint
else
options["blobstore_options"]["endpoint"] = endpoint
end
end
end
opts.parse!(ARGV.dup)
Bosh::Agent.run(options)
Jump to Line
Something went wrong with that request. Please try again.