Plugin NGINX Enterprise monitoring

Plugin for status monitoring of Nginx or Nginx plus

Introduction

Ver. 140521

With this plug-in you can monitor nginx or nginx plus.
It takes the required ip status data and generates the necessary modules.

Type: Agent plug-in

Compatibility matrix

Systems where it has been tested

CentOS 7

Systems where it should work

Any linux system

 

Prerequisites

Required :

ngx_http_stub_status_module
Pandora FMS agent installation


You need to have enabled the module "ngx_http_stub_status_module" of nginx, that is where the plugin is going to get the data from.

Configuration

Depending on whether you have manually compiled NGINX or the precompiled package you are using, the module "ngx_http_stub_status_module" may or may not be installed, to check if it is or not you can use the following command:

nginx -V | grep -o with-http_stub_status_module
with-http_stub_status_module

In this example we see that it is installed so we can use it, otherwise we must compile NGINX by adding the module:

./configure \
  --prefix=/opt/nginx \
 --sbin-path=/opt/nginx/sbin \
 --conf-path=/opt/nginx/nginx.conf \
 --pid-path=/opt/nginx/run/nginx.pid \
 --with-http_ssl_module \
 --with-http_gzip_static_module \
 --with-http_stub_status_module

Status configuration in NGINX

Let's declare status in the nginx.conf file located in /etc/nginx.

image-1621330017300.png

Add /status to the right of location, as shown in the image.

General plugin parameters

./nginx_monitor_enterprise <ip> /status

To make the plugin work, it will be executed followed by the ip to monitor (must include the nginx port) and followed by /status, as seen in configuration it is declared in "location", by default it is status, so if you put this name it won't be necessary to include it in the command.

Plugin-specific parameters

This plugin does not contain any specific parameters, we can see an example of use by running it without any parameters.

image-1621330241584.png

Manual execution

We can test the plugin from the terminal to see if it works, to check it, we run the plugin according to the parameters seen before, it will return data in XML format.

image-1621330322630.png

To check if the .exe for windows software agents works, we will do it like this, making a call to the path where it is with inverted commas:

image-1621498776440.png

Troubleshooting

By default collections have a limit of 1000000 bytes, so when we upload the plugin using collections we will get this error:

image-1621499020232.png

This has an easy solution, we will have to increase the limit of the collections, to do so we will go to configuration>configuration>enterprise :