用 monit 实现崩溃自动发送邮件提醒
本文最后更新于 1810 天前,其中的信息可能已经有所发展或是发生改变。

前言

安装 monit 教程请看 —— 在 Ubuntu 上安装 Monit 并更新至最新版,安装好 monit 后,我们就可以监控服务器和环境的状况的,这里我们将实现自动发送安全提醒电子邮件和服务器高负载提醒。

配置

修改 /etc/monit/monitrc 文件,在 第11行 将

#Mail settings

修改为:

#Mail settings
set mail-format {
  from: noreply@mail.mf8.biz
  subject: monit alert --  $EVENT
  message: $EVENT Service $SERVICE
                Date:        $DATE
                Action:      $ACTION
                Host:        $HOST
                Description: $DESCRIPTION

           Your faithful employee,
           Monit }
set mailserver smtpdm.aliyun.com port 465  username noreply@mail.mf8.biz password "your-smtp-password"
  using SSLV3 with timeout 60 seconds
set alert webmaster@wp-bullet.com ```

注意:

将

from: noreply@mail.mf8.biz


set mailserver smtpdm.aliyun.com port 465 username noreply@mail.mf8.biz password "your-smtp-password"


```bash
set alert webmaster@wp-bullet.com

设置为自己使用的邮箱,推荐参考教程: 使用邮件推送服务设置 WP SMTP 发件

评论

  1. 7年前
    2017-7-18 15:12:14

    可惜不懂代码啊,哎

    • 妙正灰
      博主
      安心财务
      7年前
      2017-7-18 17:15:10

      还是很方便的,直接复制粘贴就行

本文评论已关闭
上一篇
下一篇