Nginx virtual host traffic status module

https://github.com/vozlt/nginx-module-vts

Monitoring nginx status

Version

This document describes nginx-module-vts v0.1.18 released on 22 Jun 2018.

Dependencies

Compatibility

  • Nginx
    • 1.15.x (last tested: 1.15.0)
    • 1.14.x (last tested: 1.14.0)
    • 1.13.x (last tested: 1.13.12)
    • 1.12.x (last tested: 1.12.2)
    • 1.11.x (last tested: 1.11.10)
    • 1.10.x (last tested: 1.10.3)
    • 1.8.x (last tested: 1.8.0)
    • 1.6.x (last tested: 1.6.3)
    • 1.4.x (last tested: 1.4.7)

Earlier versions is not tested.

Screenshots

screenshot-vts-0


screenshot-vts-1

Installation

  1. Clone the git repository.
shell> git clone git://github.com/vozlt/nginx-module-vts.git
  1. Add the module to the build configuration by adding --add-module=/path/to/nginx-module-vts
  2. Build the nginx binary.
  3. Install the nginx binary.

Synopsis

http {
    vhost_traffic_status_zone;

    ...

    server {

        ...

        location /status {
            vhost_traffic_status_display;
            vhost_traffic_status_display_format html;
        }
    }
}

Description

This is an Nginx module that provides access to virtual host status information. It contains the current status such as servers, upstreams, caches. This is similar to the live activity monitoring of nginx plus. The built-in html is also taken from the demo page of old version.

First of all, the directive vhost_traffic_status_zone is required, and then if the directive vhost_traffic_status_displayis set, can be access to as follows:

  • /status/format/json
    • If you request /status/format/json, will respond with a JSON document containing the current activity data for using in live dashboards and third-party monitoring tools.
  • /status/format/html
    • If you request /status/format/html, will respond with the built-in live dashboard in HTML that requests internally to /status/format/json.
  • /status/format/jsonp
    • If you request /status/format/jsonp, will respond with a JSONP callback function containing the current activity data for using in live dashboards and third-party monitoring tools.
  • /status/format/prometheus
    • If you request /status/format/prometheus, will respond with a prometheus document containing the current activity data.
  • /status/control
    • If you request /status/control, will respond with a JSON document after it reset or delete zones through a query string. See the Control.

LEAVE A COMMENT