email alerts in keepalived – TecAdmin https://tecadmin.net How to guide for System Administrator's and Developers Tue, 19 Mar 2013 10:43:07 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 How to Enable Email Alerts in Keepalived https://tecadmin.net/how-to-enable-email-alerts-in-keepalived/ https://tecadmin.net/how-to-enable-email-alerts-in-keepalived/#comments Tue, 19 Mar 2013 10:43:07 +0000 https://tecadmin.net/?p=642 Its a good practice to enable email alerts in your keepalived configuration. By using this keepalived service will always inform users whenever server switches from master to slave or slave to master for each VRRP instance. Below steps will help you to how to enable email alerts in Keepalived. Steps to enable email alerts: Step [...]

The post How to Enable Email Alerts in Keepalived appeared first on TecAdmin.

]]>
Its a good practice to enable email alerts in your keepalived configuration. By using this keepalived service will always inform users whenever server switches from master to slave or slave to master for each VRRP instance. Below steps will help you to how to enable email alerts in Keepalived.

Steps to enable email alerts:

Step 1: Edit keepalived configuration file.

# /etc/keepalived/keepalived.conf

Step 2: Add below entry in global settings.

global_defs {
	notification_email {
        support@tecadmin.net
	}
  notification_email_from lb-alert@tecadmin.net
  smtp_server mail.tecadmin.net
  smtp_connect_timeout 30
# ...... Other configuration here .......
}

Step 3: Add smtp_alert in each VRRP instances.

vrrp_instance VI_1 {
# ...... Other configuration here .......
smtp_alert
# ...... Other configuration here .......
}

Step 4: Restart keepalived service.

# service keepalived restart

Step 5: Email alerts will be like below.

>> When VRRP instance goes to master state

Subject: [hostname] VRRP Instance VI_1 - Entering MASTER state
Message: => VRRP Instance is now owning VRRP VIPs <=

>> When VRRP instance goes to slave state

Subject: [hostname] VRRP Instance VI_1 - Entering SLAVE state
Message: => VRRP Instance is nolonger owning VRRP VIPs <=

Thanks for reading this article, I hope it will help you to enable email alerts in keepalived.

The post How to Enable Email Alerts in Keepalived appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-enable-email-alerts-in-keepalived/feed/ 1