How to monitor HTTP response error codes from nginx using munin?
Solution 1:
Well, no such animal existed, so I conjured it.
You'll find the latest code in the gist. Enjoy.
Solution 2:
I am not aware of any out-of-box OSS solutions. I personally wrote this kind of plugin, but cannot share the code. It's two stage:
- Log parser to collect fresh statistics (like
tail -f
). Since you can define Nginx log format, you are free to log the values you want, e.g. status code, upstream request time, etc. - Munin plugin to report the statistics to Munin.
You will have to share the state between these two parts. There is a handful of choices: in memory (my implementation of log parser was event-driven daemon storing all the statistics in memory); MongoDB; Redis; traditionaly MySQL; shared memory; etc.