安裝mailx
sudo yum install mailx
安裝sendmail
sudo yum install sendmail
啟動sendmail
sudo service sendmail start
開機啟動
sudo chkconfig sendmail on
先備份sudo cp etc/mail/sendmail.cf etc/mail/sendmail_bak.cf
sudo vim etc/mail/sendmail.cf
# SMTP daemon options
#注釋掉這行,重新開機服務即可
#O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA
# SMTP client options
[color=red]#O ClientPortOptions=Family=inet, Address=0.0.0.0[/color]
:wq
重新開機服務
sudo service sendmail restart
建立media Type
[img]http://dl2.iteye.com/upload/attachment/0119/2510/e553d71c-4585-3005-a3ca-316e863597d7.png[/img]
配置user,media
[img]http://dl2.iteye.com/upload/attachment/0119/2512/daa6e6a5-98bb-392e-8ac3-9b1a3ee0f24c.png[/img]
zabbix建立trriger
[img]http://dl2.iteye.com/upload/attachment/0119/2514/41ce987c-4877-3829-b113-db25bd90eb0d.png[/img]
注意激活,勾選enable和Multiple PROBLEM events generation
Multiple PROBLEM events generation:同時産生事件
建立action
1)
[img]http://dl2.iteye.com/upload/attachment/0119/2516/d55e493a-18a9-31f2-a58b-68adfabdf4dc.png[/img]
2)
[img]http://dl2.iteye.com/upload/attachment/0119/2518/23c6bfee-0eb4-34e6-8f38-9bb781a04ee6.png[/img]
3)
[img]http://dl2.iteye.com/upload/attachment/0119/2520/3ca26254-597c-3ae6-8ef5-deb323436b4a.png[/img]
檢視事件狀态
[img]http://dl2.iteye.com/upload/attachment/0119/2522/4ac46974-f1b7-3a6c-b394-4ad9f8b519ff.png[/img]
檢視狀态詳情
[img]http://dl2.iteye.com/upload/attachment/0119/2524/0f6a23cf-b981-31af-ac6c-0f755aa62832.png[/img]
從上圖中可以看出email發送成功!
email資訊:
[img]http://dl2.iteye.com/upload/attachment/0119/2526/15288c25-3b8b-3e2c-8341-7081104f41fc.png[/img]