Check manual page of nginx_status
Performance indicators of NGINX web server
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 plugin 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
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 plugin nginx_status into your
agent's plugins directory (usually /usr/lib/check_mk_agent/plugins).
The plugin 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).
A string-combination of servername and port, e.g. 127.0.0.1:80.
One service per web server will be created.