Skip to content

Instantly share code, notes, and snippets.

@jamesmoriarty
Created February 21, 2012 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesmoriarty/1879473 to your computer and use it in GitHub Desktop.
Save jamesmoriarty/1879473 to your computer and use it in GitHub Desktop.
before "newrelic:server_monitor:install", "newrelic:server_monitor:uninstall"
namespace :newrelic do
namespace :server_monitor do
task :install, :roles => :web do
run "curl -o ~/newrelic-sysmond-1.1.2.124-linux.tar.gz http://download.newrelic.com/server_monitor/release/newrelic-sysmond-1.1.2.124-linux.tar.gz"
run "tar xzvf ~/newrelic-sysmond-1.1.2.124-linux.tar.gz"
sudo "cp ~/newrelic-sysmond-1.1.2.124-linux/daemon/nrsysmond.x64 /usr/local/bin/nrsysmond"
sudo "cp ~/newrelic-sysmond-1.1.2.124-linux/scripts/nrsysmond-config /usr/local/bin"
sudo "mkdir -p /etc/newrelic /var/log/newrelic"
sudo "chmod 1777 /etc/newrelic /var/log/newrelic"
sudo "cp ~/newrelic-sysmond-1.1.2.124-linux/nrsysmond.cfg /etc/newrelic/nrsysmond.cfg"
sudo "nrsysmond-config --set license_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
sudo "/usr/local/bin/nrsysmond -c /etc/newrelic/nrsysmond.cfg"
end
task :uninstall, :roles => :web do
sudo "killall nrsysmond; echo Done"
run "rm -f ~/newrelic-sysmond-1.1.2.124-linux.tar.gz"
run "rm -fr ~/newrelic-sysmond-1.1.2.124-linux/"
sudo "rm -f /usr/local/bin/nrsysmond-config"
sudo "rm -f /etc/newrelic/nrsysmond.cfg"
sudo "rm -f /usr/local/bin/nrsysmond"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment