keepalived mail notification

 

To get mail alerts from keepalived(on every start change from MASTER to BACKUP or BACKUP to Master) we need to add following code in keepalived.conf file:

global_defs {
  notification_email {
    user@hostname.com
  }
  notification_email_from lb-alert@hostname.com
  smtp_server your.smtpserver..com
  smtp_connect_timeout 30
}

Next add following line in keepalived.conf’s vrrp_instance VI_1 block:

smtp_alert

After adding smtp_alert in vrrp_instance VI_1 block your code looks like below:

vrrp_instance VI_1 {
  ...Your Code...
  ...Your Code...
  ...Your Code...
  smtp_alert
  ...Your Code...
  ...Your Code...
  ...Your Code...
}

After making above two changes restart keepalived.

$ service keepalived restart
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s