首页 > 其他 > 详细

阿里云ECS部署ZABBIX--邮件报警媒介配置

时间:2019-10-09 16:22:17      阅读:119      评论:0      收藏:0      [点我收藏+]

 

技术分享图片

 

 

 技术分享图片

 

 

 

技术分享图片

 

 

 

#开启postfix

service postfix start

【配置mail.rc】

vim /etc/mail.rc

set from=你的邮箱名@qq.com
set smtp=smtps://smtp.qq.com
set smtp-auth-user=你的用户名
set smtp-auth-password=你的授权码(不是邮箱密码)
set smtp-auth=login
set ssl-verify=ignore

 

【创建认证】

mkdir -p /root/.certs/   ##先创建这个文件夹

下边这一大段你直接全部复制然后按回车即可,任意目录,不必犹豫!!!

echo -n | openssl s_client -connect smtp.qq.com:465 | sed -ne /-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p > ~/.certs/qq.crt

certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt

certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt

certutil -L -d /root/.certs

cd /root/.certs

certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i qq.crt

echo -n | openssl s_client -connect smtp.qiye.aliyun.com:465 | sed -ne /-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p > ~/.certs/qiye.aliyun.com.crt

certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/qiye.aliyun.com.crt

certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/qiye.aliyun.com.crt

certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i qiye.aliyun.com.crt

 

【安装mailx】

yum -y install mailx

【 查看证书文件】

[root@*** .certs]# ll
total 84
-rw-r--r-- 1 root root 65536 Apr 14 10:58 cert8.db
-rw-r--r-- 1 root root 16384 Apr 14 10:58 key3.db
-rw-r--r-- 1 root root 2281 Apr 11 22:22 qiye.aliyun.com.crt
-rw-r--r-- 1 root root 2529 Apr 11 22:06 qq.crt
-rw-r--r-- 1 root root 16384 Apr 11 21:16 secmod.db

修改完成以后测试:瞬间收到邮件

echo  "hello word" | mail -s "title"  *********@qq.com

 

阿里云ECS部署ZABBIX--邮件报警媒介配置

原文:https://www.cnblogs.com/sparkss/p/11642463.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!