Cold air blowing in the computer room-zabbix set email alert (centos7, zabbix4.4)

1. Install and test mail service

Centos's own mail service is postfix, postfix is ​​MTA (mail transfer agent), mailx is MUA (mail user agent), mailx calls postmail to send mail to users.
Install and set to boot up.

Note: The mail service occupies port 25, confirm that it is open!

yum install postfix mailx
systemctl status postfix.service 
systemctl enable postfix.service 

rpm -qa | grep postfix  #查看版本信息
mailx -V #查看mailx版本
echo "test mail" |mail -s "test mail" xxx@163.com  #测试发送邮件

Two, configure the Zabbix server email alarm

1. Set the alarm media

Open alarm media type
Fill in the relevant information of the email alarm
Name: Emial
SMTP server: Fill in the address or host name where the mail service is installed (remember to modify the hosts file). This machine is used here.
SMTP HELO: also fill in the mail server address.
SMTP email: the name of the outgoing mailbox, you can modify it yourself. Sending emails using the default localhost.localdomain will be blocked as spam.
Already used: check
2, set up the Zabbix user alarm email address

Open the user interface
Configure the receiving information of the user

3. Set the action of Zabbix to trigger the alarm

Open the action page
Add a new action
Add an action sent to the user
Set the parameters yourself
This is a recovery alarm, you can set it yourself for subsequent updates-[]w

Three, test Zabbix alarm

Shut down the Zabbix client service
systemctl stop zabbix_agentd

Check the mailbox of [email protected] and you will receive an alarm email
. After recovery, you will also receive an alarm.
Insert picture description here

Guess you like

Origin blog.csdn.net/losersnake/article/details/109025712