Check manual page of nginx_status

NGINX: Performance Indicators

Distribution Official part of Checkmk
License GPLv2
Supported Agents Linux
This check parses the information provided by the NGINX stub status module. If you have enabled that module, then the URL /nginx_status shows interesting information about the inner state of the web server when accessed from localhost. The agent plug-in nginx_status fetches these information and processes it.

Please note that the information provided do not only affect the single server within the NGINX process, but the whole NGINX process and all servers hosted by that process.

By default the check is always OK and outputs performace indicators including graphs.

First you need to enable the stub status module for a server in your NGINX installation to make it accessible, at least from localhost. We recommend to do it like follows.

Make sure that the server process is configured with the stub status module, use the command nginx -V 2>&1 | grep -o with-http_stub_status_module to check this. You should see a single line of output when you have this module available.

Now you need to add the following configuration to a NGINX site, inside the server block. On a debian system, this is located in the file /etc/nginx/sites-enabled/default. Now add the following block:

location /nginx_status 
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;

Afterwards execute /etc/init.d/nginx reload to apply this change. This makes the URL http://127.0.0.1/nginx_status available, when your server listens on port 80 on the local host. You can test this by requesting this URL on the local system using e.g. wget -qO - http://127.0.0.1/nginx_status. This should give you an output of something like Active connection: ....

Once this works, you need to install the agent plug-in nginx_status into your agent's plugins directory (usually /usr/lib/check_mk_agent/plugins). The plug-in tries to autodetect all running NGINX servers. If that fails for some reason you need to create the configuration file /etc/check_mk/nginx_status.cfg and configure your servers in that file. You find an example of that file in your agent directory (share/check_mk/agents).

Item

The servername and the port seperated by a colon, e.g. {127.0.0.1:80}.

Discovery

One service is created for each web server.