Zabbix 3.2 添加邮件报警功能
1. 安装sendmail
yum install -y sendmail yum install -y sendmail-cf chkconfig sendmail on
2. 安装mailx
yum install -y mailx
3. 发送测试邮件,验证是否成功
echo "zabbix test mail" | mail -s "zabbix" xxx@163.com
4. 添加域名
vim /etc/hosts 删除localhost.localdomain
添加:127.0.0.1 zabbix.test.com
vim /etc/mail/access 删除Connect:localhost.localdomain RELAY
添加:Connect:zabbix.test.com RELAY
vim /etc/mail/local-host-names
添加:zabbix.test.com
5. 修改本机的主机名
vim /etc/sysconfig/network
添加:HOSTNAME=zabbix.test.com
6.在Zabbix网页设置邮件报警
(1)Administration ---> Media type ---> Email
SMTP server zabbix.test.com
SMTP helo zabbix.test.com
SMTP email root@zabbix.test.com
(2)Administration ---> Users ---> Admin ---> Media
Add ---> Type --->Email Send to 自己的邮箱
(3)Configuration ---> 新建sendmail
在sendmail添加Admin用户。