Question

I'm having a hard time setting up my monitrc file. I'm using Capistrano to setup Monit on Amazon EC2, using this tutorial as a guide:

http://railscasts.com/episodes/375-monit

set daemon 30

set logfile /home/deployer/apps/example/shared/log/monit.log
set idfile /var/lib/monit/id
set statefile /var/lib/monit/state

set eventqueue
    basedir /var/lib/monit/events
    slots 100

set mailserver email-smtp.us-east-1.amazonaws.com port 587
   username "amazon_username" password "amazon_password"
   using TLSV1
   with timeout 30 seconds

set alert alerts@example.com

set httpd port 2812
    allow admin: "admin_password"

check system example_server
  if loadavg(5min) > 2 for 2 cycles then alert
  if memory > 95% for 2 cycles then alert
  if cpu(user) > 75% for 2 cycles then alert

include /etc/monit/conf.d/*

Looking at my logs, I'm getting the following error:

Sendmail error: 554 Message rejected: Email address is not verified.

I've tried other things like changing the port to 465, but with similar results.

After googling around, I found this post:

http://syshen.cc/post/14394727394/node-js-upstart-monit-and-aws-ses

It describes how to set up the sender:

To specify the sender by just “set mail {from: your-name@example.com}”.

But this syntax is nowhere to be found in the Monit documentation.

Any help would greatly be appreciated. Been pulling my hair out on this for a while.

Was it helpful?

Solution

In monit you need setup the MAIL-FORMAT directive:

As per the documentation:

SET MAIL-FORMAT {mail-format}
Example:

 set mail-format {
      from: monit@foo.bar
  reply-to: support@domain.com
   subject: $SERVICE $EVENT at $DATE
   message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION.
            Yours sincerely,
            monit
 }

The from field has to match the email that you are allowing in SES.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top