Created
February 26, 2016 19:49
-
-
Save stevecrozz/924bfb2abb8458fa9405 to your computer and use it in GitHub Desktop.
Install newrelic capistrano task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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