1.在 [server default] 下添加 指定脚本,在故障切换时实现邮件报警 [root@db-3 ~]# vi /etc/mha/app1.cnf report_script=/usr/local/bin/send_report
2.配发送邮件客户端授权 > 确保postfix 和 sendmail服务是关闭的 [root@localhost ~]# systemctl status sendmail Unit sendmail.service could not be found.
[root@localhost ~]# systemctl status postfix ● postfix.service - Postfix Mail Transport Agent Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled) Active: inactive (dead) since Sat 2020-07-04 16:55:04 CST; 10s ago
>配置mailx 授权客户端 [root@zabbix ~]# vim /etc/mail.rc ---配置文件末尾配置 set from=king008ay@163.com set smtp=smtp.163.com set smtp-auth-user=king008ay@163.com #密码是163邮箱中设置生成的 set smtp-auth-password=XAUOZAGDQHQSHPHE set smtp-auth=login