NGINX (open source) and NGINX Plus (commercial) monitoring.

Expand your current NGINX monitoring to support additional features provided via NGINX Plus web server.

Site24x7 plugins support both open source NGINX and its commercial variant NGINX Plus. The existing NGINX community version plugin has been expanded to support the advanced live activity monitoring and a lot more features in the enterprise model of NGINX Plus. Use this additional functionality to monitor your NGINX and NGINX Plus web server and stay ahead of issues.

This document details how to configure the NGINX and the NGINX Plus plugins and the monitoring metrics for providing in-depth visibility into the performance, availability, and usage stats of NGINX web servers.

NGINX performance monitoring metrics:

NGINX, a HTTP and reverse proxy server, is a free, open source product. NGINX monitoring helps you to stay ahead of issues occuring within NGINX as well as anywhere else in your web infrastructure. Various out-of-the-box metrics that we provide are:

Waiting

An active connection or a keep-alive connection can be in the Waiting state if there is no active request at the moment.

Reading

When a request is received, the connection moves from the waiting state, and the request is counted as Reading. In this state, NGINX server is reading a client request header.

Connections opened

It is the rate of connections opened per second. Monitoring connection_opened is critical to know if your reverse proxy or load balancer is optimally processing the requests in a timely manner.

Requests per second

It is the number of requests received per second. Monitoring request_per_s helps to alert on spikes or a sudden drop in the incoming web traffic.

Connections dropped

The connection_dropped is the count of dropped connections. Generally, connections are dropped when a resource limit has been reached.

Writing

After a request is read, it is counted as Writing. The request remains in the Writing state till a response is returned to the client. So while NGINX is waiting for a response from its upstream systems and operating on the response, the request will be in the Writing state.

NGINX Plus performance monitoring metrics:

NGINX Plus, the commercial version of NGINX, reports the basic open source features along with additional metrics. The enterprise version includes advanced activity monitoring and load balancing, in addition to health checks for custom pages and applications. Various metrics provided for NGINX Plus are:

Accepted and Active connections

The number of client connections attempted by NGINX is given as connections_accepted. The currently active connections (connections_active) is the same as the reading and writing states combined in open source NGINX.

Handshakes and Failed Handshakes

Both NGINX and NGINX Plus are used to terminate encrypted SSL connections, thereby reducing the load on internal servers and certificate costs. Metrics handshakes and handshakes_failed help in understanding the web server's SSL termination and gauge the capacity of hardwares or virtual machines.

Responses 1xx, 2xx, 3xx, 4xx, 5xx

The number of responses with HTTP status code types 1xx, 2xx, 3xx, 4xx, and 5xx

Reused sessions

The metric session_reuses gives the total number of SSL session credentials reused across multiple SSL connections

Requests/Responses by zone backend servers

The total number of sessions reused (session_reuses) and the total number of requests received by the zone backend servers gives an idea as to how traffic gets distributed between NGINX servers and zones.

Dropped and Idle connections

If a worker fails to obtain a connection for a particular request, then that is listed under connections_dropped. The connections_idle is the same as the waiting state in NGINX, i.e. client connections with zero current requests.

How it works?

  • Log-in to your Site24x7 account. Sign up here if you don't have one
  • Download and install the latest version of Site24x7 Linux agent
  • Install the NGINX or the NGINX Plus plugin
  • The agent will execute the NGINX or the NGINX Plus plugin and push the data to the Site24x7 server

Prerequisites:

  • Ensure that the NGINX or the NGINX Plus server is installed and is up and running
  • Ensure that the STATUS_URL in the config section is entered correctly

NGINX and NGINX Plus plugin installation:

  • Create a directory with the name "nginx" or "nginxplus" under Site24x7 Linux agent plugin directory - /opt/site24x7/monagent/plugins/
  • sudo mkdir nginx
    OR
    sudo mkdir nginxplus
  • Download the nginx.py or nginxplus.py from our GitHub repository and place it under the "nginx" or the "nginxplus" directory respectively
  • sudo wget https://raw.githubusercontent.com/site24x7/plugins/master/nginx/nginx.py
    OR
    sudo wget https://raw.githubusercontent.com/site24x7/plugins/master/nginxplus/nginxplus.py
  • Replace the shebang character "#!" with the appropriate path for Python in your system
  • Eg : #!/usr/local/bin/python3
  • By default, the plugin will monitor the NGINX or the NGINX Plus instance that is configured on "localhost". Change the value of NGINX_STATUS_URL to change the monitoring configuration
  • The server agent will report stats on the performance of NGINX or NGINX Plus server under the Plugins tab in the Site24x7 web client. In case the plugin is not listed in the Site24x7 web client, restart the agent
  • sudo /etc/init.d/site24x7monagent restart

Monitoring additional metrics:

  • To monitor additional metrics, edit the "nginx.py" or the "nginxplus.py" file and add the new metrics that need monitoring
  • Increment the plugin version value in the file "nginx.py" or the "nginxplus.py" to view the newly added metrics (For e.g., change the default plugin version from PLUGIN_VERSION = "1" to "PLUGIN_VERSION = "2")

Related plugins:

  • ActiveMQ plugin - Monitor performance metrics of your Apache ActiveMQ instances
  • Gearman plugin - Monitor performance metrics of your Gearman job servers
  • Tomcat plugin - Analyze performance of your Tomcat server
  • Twilio plugin - Ensure continued functionality of the Twilio platform
  • Out-of-the-box plugins - Monitor your entire app stack with our extensive list of integrations
  • Create custom plugins - Create custom Linux and Windows plugins and monitor custom attributes
Trusted

World's leading companies

Client

Don't have a Site24x7 account? Sign up now!