天天看点

Zabbix邮件报警设置

[root@zabbix alertscripts]# pwd
/usr/local/zabbix/alertscripts
[root@zabbix alertscripts]# vim SendEmail.sh
           
Zabbix邮件报警设置
to=$1
subject=$2
body=$3
/usr/local/bin/sendEmail  -f [email protected]  -t "$to" -s smtp.126.com -u "$subject" -o message-content-type=html -o message-charset=utf8 -xu [email protected] -xp gongjn -m "$body"
~           
Zabbix邮件报警设置
2、名称可以随便自己定义 ----- 类型选择脚本 ----- 脚本名称输入上一步编写的发送邮件的脚本名称 ----
           

再添加以下3个参数,分别对应脚本需要的3个参数:收件人地址、主题、详细内容:

{ALERT.SENDTO}

{ALERT.SUBJECT}

{ALERT.MESSAGE}