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 NameUnitDescription
nginx_connections_activeConnectionsActive ConnectionsNumber of all open connections including connections to backends
nginx_connections_readingReading ConnectionsNginx reads the request header
nginx_connections_writingWriting ConnectionsNginx reads the request body, processes the request or writes response to a client
nginx_connections_waitingWaiting ConnectionsKeep-alive connections, will be active - (reading + writing)
nginx_requests_handledHandled RequestsRequestsThe number of requests served by connections handled by Nginx
nginx_requests_rateRequests RateRequests / secondAverage number of requests per second
nginx_connections_rateConnections RateConnections / secondAverage number of connections per second
nginx_perconnections_requestsRequests Per ConnectionRequests / connectionAverage number of requests per connection.
nginx_response_timeResponse TimesecondsTime taken for Nginx request-response.
nginx_connections_droppedConnectins Dopped RateConnections / secondAverage number of dropped client connections.