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. 🙂

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s