阿里云配置zabbix 邮件发送

阿里云由于安全问题,禁用了25端口,无法对外发送邮件

登录QQ邮箱

设置–》账号–》POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务中IMAP/SMTP服务–》开启–》获得第三方登录密码

安装邮件服务

yum install -y mailx sendmail

创建证书

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 ~/.certs
certutil -A -n “GeoTrust SSL CA - G3” -t “Pu,Pu,Pu” -d ./ -i qq.crt

配置/etc/mail.rc

vi /etc/mail.rc

修改值

set smtp=”smtps://smtp.qq.com:465”
set smtp-auth=login
set smtp-auth-user=”[email protected]
set smtp-auth-password=”授权密码”
set ssl-verify=ignore
set nss-config-dir=/root/.certs

不需要重启什么服务,发送邮件

echo message3 | mail -v -r “[email protected]” -s “hello world” [email protected]

-v 打印详细信息

你可能感兴趣的:(mysql,监控)