[root@localhost ~]# cat /etc/hosts
127.0.0.1 monit.com localhost.localdomain localhost
[root@localhost ~]# cat /etc/mail/access
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
Connect:localhost.localdomain RELAY
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
Connect:monit.com RELAY
[root@localhost ~]# cat /etc/mail/local-host-names
monit.com
验证:
# telnet 127.0.0.1 25
查看进程
[root@localhost ~]# ps aux|grep sendmail
修改完成后,重启sendmail服务,通过telnet命令,测试一下看看是否已生效
[root@localhost ~]# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to monit.com (127.0.0.1).
Escape character is '^]'.
220 monit.com ESMTP Sendmail 8.13.8/8.13.8; Tue, 12 Jun 2012 18:28:27 +0800
从以上结果可以发现,localhost.localdomain 已经变成了 monit.com这个域名,设置完成!
接下来就可以在zabbix 的管理页面上进行Email 报警设置了。
描述
类型
SMTP server
monit.com
SMTP helo
monit.com
SMTP email
root@monit.com
![zabbix设置邮件告警(详细图解) - herb - herb zabbix设置邮件告警(详细图解) - herb - herb](http://img0.ph.126.net/Xb1YDghad0RD9MV9c8JW6g==/6597222598772390050.jpg)
然后高级配置——用户设置用户的报警介质,添加Email
![zabbix设置邮件告警(详细图解) - herb - herb zabbix设置邮件告警(详细图解) - herb - herb](http://img2.ph.126.net/tLUshIxgh55K61f-1DDlTA==/1581044944201373832.jpg)
新建一个action,报警方式选择Email,如图,保存测试即可!
![zabbix设置邮件告警(详细图解) - herb - herb zabbix设置邮件告警(详细图解) - herb - herb](http://img2.ph.126.net/CG0ww9_1Jx2YB4LcrwM2_A==/598134325527764302.jpg)