[root@zabbix ~]# /etc/init.d/postfix start
[root@zabbix ~]# vim /etc/mail.rc
#######set mail
set from=usertzc@163.com smtp=smtp.163.com
set smtp-auth-user=usertzc smtp-auth-password=password smtp-auth=login
[root@zabbix ~]# mail -s linuxea 734943463@qq.com < /etc/rc.local
测试脚本
[root@zabbix alertscripts]# vim /usr/lib/zabbix/alertscripts/mail.sh
#!/bin/sh
MAIL_TITLE=$2
MAIL_CON=$3
echo "$MAIL_CON" | /bin/mail -s "$MAIL_TITLE" $1
创建用户,管理---用户---创建用户
媒介而后在动作中可执行命令和发送邮件,选择邮件即可(演示效果)
模拟一次mysql挂掉