步骤启用电子邮件警报:
第1步:编辑在Keepalived配置文件。# /etc/keepalived/keepalived.conf第2步:添加下面的全局设置项。
global_defs { notification_email { support@youcl.com} notification_email_from support@youcl.comsmtp_server mail.youcl.com smtp_connect_timeout 30 # ...... Other configuration here ....... }第3步:添加smtp_alert每个VRRP实例。
vrrp_instance VI_1 { # ...... Other configuration here ....... smtp_alert # ...... Other configuration here ....... }第4步:重新启动Keepalived服务。
# service keepalived restart第5步:电子邮件警报就会像下面。 >>当VRRP实例出现掌握状态
Subject: [hostname] VRRP Instance VI_1 - Entering MASTER state Message: => VRRP Instance is now owning VRRP VIPs>>当VRRP实例去站状态
Subject: [hostname] VRRP Instance VI_1 - Entering SLAVE state Message: => VRRP Instance is nolonger owning VRRP VIPs
感谢您阅读这篇文章,我希望它会帮助你能够在
Keepalived电子邮件警报。