Nginx – Monitoring Nginx vhosts with Munin

monitoringmuninnginx

I've set up Munin and so far, loving it. I got some basic Nginx monitoring set up and am able to monitor Nginx's status and RAM usage (with stub_status compiled into Nginx and activated in the config). However, while in my adventures of getting Munin and Nginx set up to do this, I found the nginx_traffic Munin plugin. I've enabled it in Munin like I did for nginx_status and nginx_request, but my graphs for vhost traffic are still blank.

munin-node-configure --suggest shows nginx_request and nginx_status as activated and recommended, but doesn't show any other nginx_* plugins (though I have nginx_memory, and it's successfully graphing).

Can someone at least point me in the right direction for getting this plugin set up? I'd love to be able to use it.

Best Answer

I would expect the munin plugin require's nginx's status module. This is not compiled in by default, nor is it automatically made available even when it is compiled in.

Compile nginx with the --with-http_stub_status_module flag.

Make sure you've enabled stub status inside a server {} block like this:

    location /nginx_status {
            stub_status on;
            access_log off;
    }

Restart nginx so that your changes take effect.

curl http://yourdomain.example.com/nginx_status to verify nginx is in fact returning data.

Make sure munin knows the full path to your nginx_status URL.

Related Topic