本文最后更新于 2210 天前,其中的信息可能已经有所发展或是发生改变。
前言
安装 monit 教程请看 —— 在 Ubuntu 上安装 Monit 并更新至最新版,安装好 monit 后,我们就可以监控服务器和环境的状况的,这里我们将实现自动发送安全提醒电子邮件和服务器高负载提醒。
配置
修改 /etc/monit/monitrc
文件,在 第11行 将
#Mail settings
修改为:
#Mail settings
set mail-format {
from: [email protected]
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 [email protected] password "your-smtp-password"
using SSLV3 with timeout 60 seconds
set alert [email protected] ```
注意:
将
from: [email protected]
set mailserver smtpdm.aliyun.com port 465 username [email protected] password "your-smtp-password"
```bash
set alert [email protected]
设置为自己使用的邮箱,推荐参考教程: 使用邮件推送服务设置 WP SMTP 发件
可惜不懂代码啊,哎
还是很方便的,直接复制粘贴就行