Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Uncategorized»How to Enable Email Alerts in Keepalived

    How to Enable Email Alerts in Keepalived

    RahulBy RahulMarch 19, 20131 Min Read

    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 {
            [email protected]
    	}
      notification_email_from [email protected]
      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.

    email alerts in keepalived keepalived keepalived alerts vrrp
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleInstalling HTTPD Server on CentOS 6
    Next Article find Command in Linux (Search Files and Directories)

    Related Posts

    How to Setup IP Failover with KeepAlived on Ubuntu & Debian

    Updated:October 22, 20194 Mins Read

    Most Effective Industry Specific Plug-ins for WordPress

    Updated:August 15, 20163 Mins Read

    How to Install Komodo Edit on Ubuntu 14.10, 14.04 LTS and 12.04 LTS via PPA

    1 Min Read

    Setup Database Mirroring in SQL Server 2012 with Certificates

    3 Mins Read

    IP FailOver Setup Using KeepAlived on CentOS & Red Hat

    Updated:November 7, 20174 Mins Read

    How to Install XCache for PHP on CentOS,RHEL and Fedora

    2 Mins Read

    1 Comment

    1. Nikola on April 4, 2021 1:48 am

      Thank you friend, this solved my problem!

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • What is CPU? – Definition, Types and Parts
    • What is the /etc/aliases file
    • What is the /etc/nsswitch.conf file in Linux
    • How to Install Ionic Framework on Ubuntu 22.04
    • What is the /etc/hosts file in Linux
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.