Skip to content

Instantly share code, notes, and snippets.

@stevecrozz
Created February 26, 2016 19:49
Show Gist options
  • Select an option

  • Save stevecrozz/924bfb2abb8458fa9405 to your computer and use it in GitHub Desktop.

Select an option

Save stevecrozz/924bfb2abb8458fa9405 to your computer and use it in GitHub Desktop.
Install newrelic capistrano task
ask(:newrelic_license_key, '')
desc 'Install newrelic-sysmond'
task :install_newrelic_sysmond do
on roles(:all) do
unless test("command -v nrsysmond-config >/dev/null 2>&1")
execute 'echo deb http://apt.newrelic.com/debian/ newrelic non-free | sudo tee /etc/apt/sources.list.d/newrelic.list'
execute 'curl --silent https://download.newrelic.com/548C16BF.gpg | sudo apt-key add -'
sudo 'apt-get update'
sudo 'DEBIAN_FRONTEND=noninteractive apt-get install -y newrelic-sysmond'
sudo "nrsysmond-config --set license_key=#{fetch(:newrelic_license_key)}"
sudo '/etc/init.d/newrelic-sysmond start'
end
end
end
before :starting, :install_newrelic_sysmond
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment