Munin, monitoring & emailed alerts

emailmonitoringmuninpostfix

I've got several servers serving some websites.

I've got Munin set up so I can track things like memory consumption, disk usage, etc.

What I'd like to have now would be a way to get emails if something goes "wrong". Let me be more specific:

  • I'd like to get an email if any of my websites is down (timeouts)
  • I'd like to get an email if my postfix mail is not responding (Not from the same mail server, of course) This can be accomplished by a telnet command, I'm told.

From what I've read, Munin isn't quite the tool for this. It can send you emails, but the conditions it detects seem to be only of type "xxx exceeds the threshold" – i.e. "memory is 95% full".

Am I correct about Munin? If yes, what is the easiest way of accomplishing this? Maybe Nagios?

Best Answer

I'll second the above suggestions for NAGIOS. Lke vIM, it has a bit of a learning curve, but it's entirely worth it when you get over the hump.

You'll excuse my lack of knowledge regarding Munin, but the concept of a metric and a website state can't be that hard. Surely there's a data timeout/data read plugin, and you can set a reasonable expectation for when you should get a response for the webserver, and if it's longer than somewhere in the range of 5-10 seconds, you send an e-mail.

This can be done rudimentarily done for mail servers too. You should expect something to be returned on the POP3/IMAP and SMTP ports within a reasonable amount of time. And if you don't have any content then you should send an e-mail.

Aside from all of that, I really really suggest NAGIOS if Munin proves to be too difficult in implementing this. The nagios-plugins package ships a check_http and check_(imap|pop|smtp) script. All you have to do is hook the command line arguments (time thresholds, predominately), and you're done.