Loading

MMM 2.x Email Notifications

MMM used to have an email notification system in the 1.x version. It has been removed in 2.x and instead it relies on Log4Perl to send emails. The default in the latest version does not send anything, so if you want to get notified when things change in your MMM cluster, you need a logging config file.

Here is what I’m using to log INFO and above to a standard log file and email me for any FATAL messages (filename is /etc/mysql-mmm/mmm_mon_log.conf):

log4perl.logger = INFO, LogFile, MailFatal

log4perl.appender.LogFile                           = Log::Log4perl::Appender::File
log4perl.appender.LogFile.Threshold                 = INFO 
log4perl.appender.LogFile.filename                  = /var/log/mysql-mmm/mmm_mond.log
log4perl.appender.LogFile.recreate                  = 1
log4perl.appender.LogFile.layout                    = PatternLayout
log4perl.appender.LogFile.layout.ConversionPattern  = %d %5p %m%n

log4perl.appender.MailFatal = Log::Dispatch::Email::MailSend
log4perl.appender.MailFatal.Threshold = FATAL 
log4perl.appender.MailFatal.to = your@emailaddress.com
log4perl.appender.MailFatal.buffered = 0
log4perl.appender.MailFatal.subject = FATAL error in mmm_mond
log4perl.appender.MailFatal.layout = PatternLayout
log4perl.appender.MailFatal.layout.ConversionPattern = %d %m%n

Related Posts

  1. iPhone/iPad UISearchBar and UISearchDisplayController Asynchronous Example
  2. High Availability on a Shoestring -- Postgresql 9.0 Streaming Replication
  3. SPF Records with Rails and ActionMailer
  4. High Availability on a Shoestring -- MMM Mysql Multi-master Replication Manager
  5. High Availability on a Shoestring -- Database Replication and Failover Alternatives
You should follow me on Twitter: @patrickxb