Installing Munin plugins for Memcached and Nginx

21 Apr

I probably wasn’t very sharp when I installed these plugins for Munin, but the thing is I stumbled upon several small complications and so few information about them, so I’m posting this in case anyone can find it useful.

Munin plugins

Installing Munin plugins is easy, and there’s plenty of information around. The only thing you have to keep in mind is if the plugin name end in underscore, for example memcached_, means that when you create the symbolic links in /etc/munin.d/plugins you have to put after the underscore the parameter to monitorize. Best way is take a look into the plugin source code to see what parameters are supported.

Nginx plugin for Munin

You can get it at muninexchange, very interesting site for the munin freaks by the way, in particular here. There’re two, nginx_request and nginx_status.

With Debian Etch I have to install the Perl lib libwww-perl and recompile Nginx with the parameter –with-http_stub_status_module, to get the module ngx_http_stub_status_module enabled. To use this module you have to add some lines in your Nginx config file. It’s rather simple but I’m not going to enter in the details here. You can read further about it in the wikipage for the module or in this link.

By the way, if recompiling Nginx scares the hell out of you, check out this page, because Nginx has a fancy and useful signal system that allows you to install a new version without having down the server not for one sec.

Memcached plugin for Munin

The Memcached plugin I installed is in the Munin site, specifically here. This is one of the kind of plugins I mention in the beginning, ii can monitorize three parameters just depending on how we create the symbolic links.

With Debian Etch I have to installed the Perl lib libcache-memcached-perl. But please, pay attention, seems like the lib Cache::Memcache doesn’t work properly with the stats() function, needed by the plugin to get the Memcache information. In order to get it working you will need to apply this patch. A simple patch /usr/share/perl5/Cache/Memcached.pm perlmemcached.patch fixes the thing.

Check everything

Easy, either we restart Munin and wait till it starts to compile information to check the logs out and see if everything is working fine; or, the straightforward way, we run munin-run follow by the plugin name, and see if the output seems to be correct (not NaN for example).

Comments are closed.