zabbix/zabbix-docker

Feature request - enable NGINX stub_status for monitoring

Zablove opened this issue · 2 comments

Zabbix provide a NGINX template to provide NGINX monitoring. This template however requires the stub_status module to be enabled. https://www.zabbix.com/integrations/nginx

My suggestion would be to enable this by default at IP 127.0.0.1 and create a variable so that you will be able to change the source IP because the checks will not be performed by an agent installed at the container.

NGINX suggests the stub_status page not to publish to everyone: https://www.nginx.com/blog/avoiding-top-10-nginx-configuration-mistakes/

Probably also a good idea to restrict access to the current status and ping pages.

Current config:

    location ~ ^/(status|ping)$ {
        access_log off;
        fastcgi_pass   unix:/tmp/php-fpm.sock;

        fastcgi_param  SCRIPT_FILENAME  $webroot$fastcgi_script_name;
        include fastcgi_params;
    }

Suggestions:
Status and ping page:

    location ~ ^/(status|ping)$ {
        access_log off;
        allow 127.0.0.1; #<variable
        fastcgi_pass   unix:/tmp/php-fpm.sock;

        fastcgi_param  SCRIPT_FILENAME  $webroot$fastcgi_script_name;
        include fastcgi_params;
    }

Basic_status page:

location = /basic_status {
        stub_status;
        allow 127.0.0.1; #<variable
}