def agent_should_start?
return false if already_started? || disabled?
if defer_for_delayed_job?
::NewRelic::Agent.logger.debug "Deferring startup for DelayedJob"
return false
end
if defer_for_resque?
::NewRelic::Agent.logger.debug "Deferring startup for Resque in case it daemonizes"
return false
end
unless app_name_configured?
NewRelic::Agent.logger.error "No application name configured.",
"The Agent cannot start without at least one. Please check your ",
"newrelic.yml and ensure that it is valid and has at least one ",
"value set for app_name in the #{NewRelic::Control.instance.env} ",
"environment."
return false
end
unless NewRelic::Agent::NewRelicService::JsonMarshaller.is_supported?
NewRelic::Agent.logger.error "JSON marshaller requested, but the 'json' gem was not available. ",
"You will need to: 1) upgrade to Ruby 1.9.3 or newer (strongly recommended), ",
"2) add the 'json' gem to your Gemfile or operating environment, ",
"or 3) use a version of newrelic_rpm prior to 3.14.0."
return false
end
return true
end