GitXplorerGitXplorer
r

ngx-system-info

public
1 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
6f78751b6bc07960708e98f14cb757c83950c7c1

dynamic module support

rroryrjb committed 6 years ago
Unverified
3a7b5b416932f810c7df6b4b2e39bf68d22a3878

linting, tidy up

rroryrjb committed 6 years ago
Unverified
86c13568227f3464a33e29ef3d5ed4011ef85f42

shell linting

rroryrjb committed 6 years ago
Unverified
084cea188634d8ce351422ee587e7f5aab1a1df0

remove test dir

rroryrjb committed 7 years ago
Unverified
f42d9e9a3ce725c23d9430530d727c4cf79e986d

words

rroryrjb committed 7 years ago
Unverified
54d0308ca468780f8a78dcc4bafc8cf509894f08

testing

rroryrjb committed 7 years ago

README

The README file for this repository.

ngx-system-info

Nginx module for displaying sysinfo as JSON (Linux only).

Installation

Firstly clone this repo somewhere.

Download Nginx source:

$ wget https://nginx.org/download/nginx-VERSION.tar.gz
$ tar -xzf nginx-VERSION.tar.gz
$ cd nginx-VERSION

Build as static module:

$ ./configure --add-module=/path/to/ngx-system-info
$ make
$ sudo make install

Build as a dynamic module:

Compiles with at least the following versions of Nginx:

  • 1.6.3
  • 1.8.1
  • 1.10.3
  • 1.12.2
  • 1.14.0

Usage

Specify a location in your Nginx configuration to display the data, which will be output as JSON (application/json):

location /system_info {
  system_info;
}

Example output:

{
  "uptime": 3618,
  "totalram": 8223174656,
  "freeram": 3047157760,
  "loadavg": [
     1.29,  0.84,  0.81
  ],
  "sharedram": 166408192,
  "bufferram": 102264832,
  "totalswap": 8438935552,
  "freeswap": 8438935552,
  "procs": 857
}

Testing

There's an included Dockerfile that will build this module against various versions of Nginx and do a simple curl test against an endpoint.

$ make test