A few years ago, I posted about our over-architected setup here at Codebetter. I had fun working with Rackspace cloud slices, and getting this all to run on ridiculously cheap, 256 M linux hosts. One of the tools I’ve come to depend on for monitoring is Munin.
Munin is a networked resource monitoring tool that can help analyze resource trends and “what just happened to kill our performance?” problems. It is designed to be very plug and play. A default installation provides a lot of graphs with almost no work.
Here’s the graph of CPU usage since yesterday. Munin let’s you drill down into almost any aspect of your system, with plugins to allow you to monitor almost any service you may be running, and even support for monitoring Windows boxes.
I’ve recently migrated to new servers yet again, and I ran into a few gotcha’s for Ubuntu 12.10 users that I’d like to post here. It seems that most apps (WordPress for example) are much easier to configure under Apache than Nginx, and Munin is no different. If you crave the performance and configurability that Nginx brings, you’ll probably be used to taking a few extra steps to get applications to run properly. This page from the Munin docs has some good starting points for setting up under Nginx, but even so I got stuck. There’s one sentence that says the following:
Note: Depending on your installation method, the “munin-*-graph” programs may be in another directory. Check Makefile.config if you installed from source, or your package manager if you used that to install.
This may be obvious to some, but I ran into all sorts of problems until I understood what changes I had to make for everything to work.
1) Correct the path to the munin-cgi-graph and munin-cgi-script perl files, when you create your fast-cgi sockets
2) Correct NGINX configuration, here’s mine. Notice the location /muni-cgi/ changes to /cgi-bin/. Also notice that I’m running Munin at /, not /munin/ on my web server.
That’s it! Happy monitoring!