Creamos el archivo de configuración de nginx
$ cd /etc/nginx/sites-available
$ vi ngx_http_stub_status.conf
server {
listen 127.0.0.1:80;
server_name localhost;
location = /nginx_stub_status {
stub_status on;
allow 127.0.0.1;
deny all;
}
}
Descargar el archivo newrelicnginxagent.tar.gz
$ cd /opt
$ wget http://nginx.com/download/newrelic/newrelic_nginx_agent.tar.gz
Desempaquetar el archivo
$ tar -xzf newrelic_nginx_agent.tar.gz
$ cd newrelic_nginx_agent
Ejecutar bundle install para bajar las gemas necesarias
$ bundle install
Creamos una copia del archivo de configuración
$ cp config/newrelic_plugin.yml.in config/newrelic_plugin.yml
Establecemos la llave en el archivo config/newrelic_plugin.yml
newrelic:
#
# Update with your New Relic account license key:
#
license_key: '3ceb64f824d6b44d821e9ffc861666d6e1b1dad0'
#
# Set to '1' for verbose output, remove for normal output.
# All output goes to stdout/stderr.
#
verbose: 1
#
# Agent Configuration, describe your nginx instances here
#
agents:
nginx_status_agent:
-
instance_name: ISACLOUD01
status_url: http://localhost/nginx_stub_status
# http_user: status
# http_pass: status_pass
# -
# instance_name: example.org
# status_url: http://example.org/status
# -
# instance_name: example.com
# status_url: http://example.com/status
Corremos el demonio
$ ./newrelic_nginx_agent.daemon start