centos7--部署邮件报警

首先,关闭防火墙

[root@ c7-41 ~] systemctl stop firewalld.service 
[root@ c7-41 ~] setenforce 0

1,安装邮件报警服务–mailx

[root@ c7-41 ~] yum -y install mailx

2,修改配置文件

[root@ c7-41 ~] vim /etc/mail.rc #在末尾行插入参数
[root@ c7-41 ~] cat /etc/mail.rc |sed -n '70,74p'
set from=[email protected] #QQ邮箱地址
set smtp=smtp.qq.com #邮箱类型,可以是其他类型
set smtp-auth-user=[email protected] #QQ邮箱地址
set smtp-auth-password=xxxxxxxxxxxxxxx #授权码
set smtp-auth=login 

3,测试邮件报警
在这里插入图片描述
这样就部署好了,简单便捷,也可以写进脚本里操作

发布了68 篇原创文章 · 获赞 107 · 访问量 4361

猜你喜欢

转载自blog.csdn.net/xiaohuai0444167/article/details/105736068