Created
February 21, 2012 22:29
-
-
Save jamesmoriarty/1879473 to your computer and use it in GitHub Desktop.
This file contains 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
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