I was so excited when setting up New Relic. The tool seemed so fresh and slick!
Everything was going smoothly until I started to setup nginx agent. The process has been finished, but there was an error.
β NGINX Open Source Integration (unsupported)
Installation incomplete. Follow the instructions at the URL below to complete the installation process.
This happened on every machine π
Re-installing did no help π
The docs they offered were too messy and also did not help π
I started to search their forum. It turns out to be a popular problem. The only solution they offered is to contact support. But I need to pay before getting access to support. Such a shame! π€
So I spend a few hours with ChatGPT and a barrel of coffee and figured it out. Here is a step-by-step guide on how to install a New Relic agent on your nginx.
The guide
1) Proceed with the agent install process as they say in the docs.
Use the generated cURL link to install the New Relic agent. Then install the nginx agent: sudo apt install nri-nginx
.
2) Throw in those to create a config file.
cd /etc/newrelic-infra/integrations.d
sudo cp nginx-config.yml.sample nginx-config.yml
sudo cp /etc/newrelic-infra/logging.d/nginx-log.yml.example /etc/newrelic-infra/logging.d/nginx-log.yml
3) Check if your nginx has the required monitoring module called http_stub_status_module
.
nginx -V 2>&1 | grep -o with-http_stub_status_module
If your nginx does not have it, get it. Mine had.
4) Change the status URL:
cd /etc/newrelic-infra/integrations.d
sudo nano nginx-config.yml
Set STATUS_URL to something like this:
STATUS_URL: https://my-domain.com/status
where my-domain.com
is a domain from your nginx config.
5) Restart it.
sudo systemctl restart newrelic-infra
6) Add the status page and the IP of your server:
cd /etc/nginx/sites-enabled && nano default
server {
# other stuff
server_name my-domain.com;
location /status {
stub_status on;
access_log off;
allow 1.1.1.1; # set your server IP here π¨
}
# other stuff
}
7) Reload nginx:
sudo service nginx reload
Go to New Relic and have fun.
Oldest comments (2)
Hi, @alexanderisora!
Thank you so much for the shout-out! We always love to hear about our users' experiences using New Relic, especially with GPT being a new integration of ours.
As a thank you, Iβd love to send you some swag! Please email me directly at dalvarado@newrelic.com for details.
Furthermore, feel free to follow us on our New Relic Dev.to page for more updates and how-to's on all things observability and monitoring.
Happy monitoring!
Daniel
cool! will do. thanks.