Nginx – How to monitor HTTP response error codes from nginx using munin

monitoringmuninnginx

I'm beginning to use Munin to monitor an in-production Nginx server. One thing I'm particularly interested in graphing is the rate of errors–HTTP responses with codes in the 50x range. I'm wondering if:

  1. Is there an existing plugin to do this?
  2. Alternately, what would be the best approach to writing my own plugin. Access log parsing?

Best Answer

Well, no such animal existed, so I conjured it.

You'll find the latest code in the gist. Enjoy.