配置sendmail软件
1、禁用postfix
systemctl stop postfix
systemctl disable postfix
2、安装sendmail
yum -y install sendmail
3、安装mailx
yum -y install mailx
4、配置/etc/mail.rc
追加以下配置到/etc/mail.rc :
#设置代理发送邮件的用户名
set [email protected]
#设置发送邮件服务器
set smtp=smtp.exmail.qq.com
#设置代理发送邮件的用户名
set [email protected]
#设置代理发送邮件的用户密码
set smtp-auth-password=xxxxxx
5、手动发送测试邮件
echo "hello zabbix test" | mail -s "this is a test zabbix file" [email protected]
#echo:代表发送内容;-s代表文件主题内容;[email protected]代表发送给谁的邮件地址
6、发送成功会收到测试邮件:
配置zabbix_server web端报警媒介类型
编辑Email,内容如下:
配置用户报警媒介
配置动作
这会手动触发消息,测试邮件发送
我这里是手动重启交换机,邮件发送成功,如下: