Setup Monit email alert using Yandex's SMTP

There are many ways to monitor a server, one of them is using Monit, a tool which will always check the services running on the server and it can send alert when there is a problem.

Monit also has the ability to restart any service with some triggers.

Here are an example of Monit config to use Yandex’s SMTP for email alerts.

set mailserver smtp.yandex.com port 587
username "enak@yandex.com" password "p4$W0_rD"
using sslv3

set alert lol@tfq.me

check system vmi69564.contabo.host
if memory usage > 80% for 2 cycles then alert
if cpu usage (user) > 70% for 2 cycles then alert
if cpu usage (system) > 30% then alert
if cpu usage (wait) > 20% then alert
if loadavg (1min) > 6 for 2 cycles then alert
if loadavg (5min) > 4 for 2 cycles then alert
if swap usage > 5% then alert

check filesystem rootfs with path /
if space usage > 80% then alert

That’s it. 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.