Skip to content

Instantly share code, notes, and snippets.

@boppy
Forked from jcdarwin/monit-and-gmail
Created June 9, 2019 15:37
Show Gist options
  • Save boppy/500b3c24a1d92c439c942cf127e5fbd6 to your computer and use it in GitHub Desktop.
Save boppy/500b3c24a1d92c439c942cf127e5fbd6 to your computer and use it in GitHub Desktop.
How to allow monit to use gmail as a smtp relay to send out alert emails
# visit https://accounts.google.com/DisplayUnlockCaptcha and click to allow access
# edit /etc/monit/monitrc to include the following
set mailserver smtp.gmail.com port 587
username "whoever@gmail.com" password "whatever"
using tlsv1
with timeout 30 seconds
# run the following to validate access
/etc/init.d/monit restart
monit validate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment