NGINX is a web server that can also be used as a reverse proxy, load balancer, mail proxy, and HTTP cache. The software was created by Igor Sysoev and publicly released in 2004.

Prerequisites

  1. Add the following to /etc/nginx/sites-available/default inside server{}
location /nginx_status {
        stub_status;
        allow all;
    }
  1. For Virtual Machines, install the Linux Agent.

Configuring the credentials

Configure the credentials in the directory /opt/opsramp/agent/conf/app.d/creds.yaml

nginx:
- name: nginx
  user: <username>
  pwd: <Password>
  encoding-type: plain
  labels:
    key1: val1
    key2: val2

Configuring the application

Virtual machine

Configure the application in the directory /opt/opsramp/agent/conf/app/discovery/auto-detection.yaml

- name: nginx
  instance-checks:
    service-check:
      - nginx
    port-check:
      - 80
    uri-check:
      - "nginx_status"

By default, nginx_status is considered as the URI.

Docker environment

Configure the application in the directory /opt/opsramp/agent/conf/app/discovery/auto-container-detection.yaml

- name: nginx
  container-checks:
    image-check:
      - nginx
    port-check:
      - 80

Kubernetes environment

Configure the application in config.yaml

- name: nginx
  container-checks:
    image-check:
      - nginx
    port-check:
      - 80

Validate

Go to Resources under the Infrastructure tab to check if your resources are onboarded and the metrics are collected.

Metrics

OpsRamp MetricMetric Display NameUnit
nginx_connections_active

Number of all open connections including connections to backends
ConnectionsActive Connections
nginx_connections_reading

Nginx reads the request header
Reading Connections
nginx_connections_writing

Nginx reads the request body, processes the request or writes response to a client
Writing Connections
nginx_connections_waiting

Keep-alive connections, will be active - (reading + writing)
Waiting Connections
nginx_requests_handled

The number of requests served by connections handled by Nginx
Handled RequestsRequests
nginx_requests_rate

Average number of requests per second
Requests RateRequests / second
nginx_connections_rate

Average number of connections per second
Connections RateConnections / second
nginx_perconnections_requests

Average number of requests per connection.
Requests Per ConnectionRequests / connection
nginx_response_time

Time taken for Nginx request-response.
Response Timeseconds
nginx_connections_dropped

Average number of dropped client connections.
Connectins Dopped RateConnections / second