Agent Nginx status configuration
The agent can parse the Nginx HttpStubStatusModule output to show the current requests per second and number of connections. This metric is only available for paid accounts. It also requires some additional configuration of your Nginx server.
If you do not wish to monitor Nginx then leave the default value in the config.cfg file and the agent will ignore it.
Configuring Nginx
HttpStubStatusModule module
You first need to ensure the HttpStubStatusModule module is installed. This is not available by default and must be compiled in with the right configure line:
--with-http_stub_status_module
HttpStubStatusModule configuration
Adding the following lines to your nginx.conf file and within a server { } block will enable the status output.
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
You should replace the IP address 127.0.0.1 with your server's public IP address. This will allow the status output to be accessed from a URL http://yourserver/nginx_status. However, it has been restricted to the server IP address which means it can only be accessed from the server itself - this is for security so that only the agent can access the output. If you wish to access it from your browser, you need to add your IP address in. For example:
allow 127.0.0.1; allow 127.0.0.2;
You will now need to restart your Nginx web server to allow the changes to take effect.
Agent configuration
You need to enter the URL into the agent config.cfg file for the nginx_status_url option. If your server's IP was 127.0.0.1 then this URL would be http://127.0.0.1/nginx_status.
nginx_status_url: http://127.0.0.1/nginx_status
Save the file and restart the agent and the Nginx status data will be reported and display in the interface within 2 minutes (the first report cycle will not include the Nginx statistics):
python agent.py restart