Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
March 20, 2023 05:53 pm GMT

Guide: Installing New Relic Agent on Nginx

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 or sudo apt install nri-nginx.

2) Throw in those to create a config file.

cd /etc/newrelic-infra/integrations.dsudo cp nginx-config.yml.sample nginx-config.ymlsudo 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.dsudo 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.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.


Original Link: https://dev.to/alexanderisora/guide-installing-new-relic-agent-on-nginx-44m2

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To