1.安装邮件发送工具mailx
由于我们这里使用的mailx作为邮件发送工具,所以先关闭其他自带的邮件服务,在zabbix服务器上执行以下命令:
service sendmail stop #关闭sendmail
systemctl disable sendmail.service #禁止开机启动sendmail
service postfix stop #关闭postfix
systemctl disable postfix.service #禁止开机启动postfix
安装mailx工具 yum -y install mailx
2.配置zabbix服务器外部邮箱
vim /etc/mail.rc 打开文件,加入如下内容:
set from=xx@aduer.com #这里写发送邮件的邮箱
set smtp=smtps://smtp.exmail.qq.com:465 #这里写发送邮箱中查到的smtp地址,一般在邮箱的设置中可以看到
set smtp-auth-user=xx@aduer.com #这里也是写发送邮件的邮箱
set smtp-auth-password=123456 #这里写登陆邮箱的密码
set smtp-auth=login #登陆
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb/
se