zabbix告警邮件配置

1.安装sendmail,mailx
 
2配置mailx,配置文件为/etc/mail.rc

set sendcharsets=iso-8859-1,utf-8
set bsdcompat
set from=mailuser
set smtp=mailserver
set smtp-auth-user=user
set smtp-auth-password=123456
set smtp-auth=login

3.配置sendmail脚本

/usr/local/etc/alertscripts/sendmail.sh
#!/bin/bash
messages=`echo $3 | tr ' ' ' '`
subject=`echo $2 | tr ' ' ' '`
echo "${messages}" | mail -s "${subject}" $1 >>/tmp/sendmail.log 2>&1
原文地址:https://www.cnblogs.com/victor0/p/13614987.html