Host name in subject line of mail log

46 views
Skip to first unread message

marvelli

unread,
Dec 19, 2011, 6:09:49 AM12/19/11
to MySQL Multi Master Manager Development
I'd like to add the hostname affected to the mmm_mon email alert.

In the docs, the line is:
log4perl.appender.MailFatal.subject = FATAL error in mysql-mmm-monitor

I have a server that isn't quite fast enough to keep up with
replication and I would like to filter replication delay warnings from
that server. It just replicates for backup purposes, so a delay on
that machine isn't critical at all, while on others it is.
But the alerts are swamping my mail with quite unimportant alerts,
therefore I'd like to filter the mail based on the subject.

Another option would be to configure different logging for different
machnines, but I don't see how the monitor could do that.

Regards
Werner

Mike!

unread,
Dec 19, 2011, 6:16:13 AM12/19/11
to mmm-...@googlegroups.com

Hi,

i've solved this problem with a logging config on the db server:
mmm_agent_log.conf:

log4perl.logger = INFO, LogFile,MailFatal,MailInfo

log4perl.appender.LogFile = Log::Log4perl::Appender::File
log4perl.appender.LogFile.Threshold = INFO
log4perl.appender.LogFile.filename = /var/log/mysql-mmm/mmm_agentd.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 = root
log4perl.appender.MailFatal.buffered = 0
log4perl.appender.MailFatal.subject = DBSERVER1::FATAL error in mmm_agentd
log4perl.appender.MailFatal.layout = PatternLayout
log4perl.appender.MailFatal.layout.ConversionPattern = %d %m%n

log4perl.filter.Match1 = sub { /Deleted/ }
log4perl.filter.Match2 = sub { /Added/ }
log4perl.filter.RoleFilter = Log::Log4perl::Filter::Boolean
log4perl.filter.RoleFilter.logic = Match1 || Match2
log4perl.appender.MailInfo = Log::Dispatch::Email::MailSend
log4perl.appender.MailInfo.Filter = RoleFilter
log4perl.appender.MailInfo.Threshold = INFO
log4perl.appender.MailInfo.to = root
log4perl.appender.MailInfo.buffered = 0
log4perl.appender.MailInfo.subject = DBSERVER1::MMM: role change
log4perl.appender.MailInfo.layout = PatternLayout
log4perl.appender.MailInfo.layout.ConversionPattern = %d %m%n

Hope this helps... it's not the most elegant solution, but it works

Mike

Reply all
Reply to author
Forward
0 new messages