Keepalived : How to set E-mail Alert & Service Check
Keepalived : How to set E-mail Alert & Service Check
Configuration:
Please add following configuration to /etc/keepalived/keepalived.conf For e-mail alert . For Installation and other Please follow this Link.
Master node:
global_defs {
router_id nginx03
notification_email {
manas.tri@gmail.com
}
notification_email_from root@nginx01 --> Email From
smtp_server example.com --> SMTP Server
smtp_connect_timeout 30
}
vrrp_instance nginxS_general {
state MASTER
interface eth0
virtual_router_id 3
priority 50
advert_int 1
smtp_alert --> In the Instance configuration Add this line
authentication {
auth_type PASS
auth_pass lookbeautiful
}
virtual_ipaddress {
192.168.2.3/24 dev eth0 label eth0:0
}
notify /etc/pound2/notify.sh --> Now you can create script and invoke it by notify option.
}
Backup Node:
global_defs {
router_id nginx03 ----> Router ID
notification_email {
manas.tri@gmail.com
}
notification_email_from root@nginx03
smtp_server example.com
smtp_connect_timeout 30
}
vrrp_instance nginxS_general {
state BACKUP
interface eth0
virtual_router_id 3
priority 40
advert_int 1
smtp_alert --> In the Instance configuration Add this line
authentication {
auth_type PASS
auth_pass lookbeautiful
}
virtual_ipaddress {
192.168.2.3/24 dev eth0 label eth0:0
}
notify /etc/pound2/notify.sh --> Now you can create script and invoke it by notify option.
}
Configuration:
Please add following configuration to /etc/keepalived/keepalived.conf For e-mail alert . For Installation and other Please follow this Link.
Master node:
global_defs {
router_id nginx03
notification_email {
manas.tri@gmail.com
}
notification_email_from root@nginx01 --> Email From
smtp_server example.com --> SMTP Server
smtp_connect_timeout 30
}
vrrp_instance nginxS_general {
state MASTER
interface eth0
virtual_router_id 3
priority 50
advert_int 1
smtp_alert --> In the Instance configuration Add this line
authentication {
auth_type PASS
auth_pass lookbeautiful
}
virtual_ipaddress {
192.168.2.3/24 dev eth0 label eth0:0
}
notify /etc/pound2/notify.sh --> Now you can create script and invoke it by notify option.
}
Backup Node:
global_defs {
router_id nginx03 ----> Router ID
notification_email {
manas.tri@gmail.com
}
notification_email_from root@nginx03
smtp_server example.com
smtp_connect_timeout 30
}
vrrp_instance nginxS_general {
state BACKUP
interface eth0
virtual_router_id 3
priority 40
advert_int 1
smtp_alert --> In the Instance configuration Add this line
authentication {
auth_type PASS
auth_pass lookbeautiful
}
virtual_ipaddress {
192.168.2.3/24 dev eth0 label eth0:0
}
notify /etc/pound2/notify.sh --> Now you can create script and invoke it by notify option.
}
Sample Alert:
=> VRRP Instance is nolonger owning VRRP VIPs <=
Now you can create script and invoke it by notify option.
TYPE=$1
NAME=$2
STATE=$3 --> State Could be Backup,Master and Fault.
No comments