Both SendMail and postfix can send mail if the service is already started.
The purpose of setting up the trigger is to let the monitoring service implement the alarm, how to tell the alarm, let us configure the message alarm. E-mail is sent by the server through its own SendMail service, sometimes if the configuration is not appropriate or the service does not start, we are not outgoing mail. So, test it first.
Note: The following actions are done on the Zabbix server
# Yum install-y sendmail
#/etc/init.d/sendmail Start
# echo "Test Mail" |mail-s "testtest" [email protected]
If it is a virtual machine, it is possible to receive the mail, but if the real machine can still be received, but most likely in the Junk mail box. Let's configure Zabbix email alerts.
# mkdir-p/home/zabbix/bin
# vim/home/zabbix/bin/baojing.sh
The contents are:
#! /bin/bash
echo "$" |/bin/mail-s "$" $
After saving, modify the permissions of the file
# chmod +x/home/zabbix/bin/baojing.sh
In the/etc/zabbix_server.conf configuration file, there are parameters Alertscriptspath and externalscripts, edit it
# vim/etc/zabbix_server.conf
Modify the following content
alertscriptspath=/home/zabbix/bin/#用户自定义的 Media Types script
externalscripts=/home/zabbix/bin/#用户自定义的检查的脚本 (item)
Below in the browsing inside continue to configure the message alarm.
Create MEDIEA types: "Administration"--"Media types", click on the top right corner "create media Type" which
Description fill in "baojing" or other custom name, Type select "Script", Script "baojing.sh" and then
Point "Save".
Create User: "Adimistration"-"users" in the upper right corner, select "Users", click "Create User", alias:
Test1, customize name and LastName Password:123456;group Select Guest, go back to the top for a bit media,type
Select Baojing,send to write the mailbox you want to send the message to, click Add, and save the last point.
Create action: "Configuration"--actions, top right corner "create actions", Name customization, I'm here
Write "baojing", other default, then point to the right of "Operations" under "New" button, "Operation Type" select
"Send Message", "Send Message to" Select one or more user groups to send the message, Send to users select
We previously added test1, "Send only to" select Baojing, click Add, Last click Save.
2.0-zabbix Configuring Message Alarms