Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Have someone used Linux heartbeat to send email when the Slave server becomes the Master?
I've read I can configure the MailTo under
/etc/ha.d/resource.d
but I really don't know how to do it.
I basically need my primary server to send an email when it becomes inactive and all the activities are manage by the secondary node
If I'm correct you have to set something up like this in both nodes (in the haresources file):
Code:
primitive mail ocf:heartbeat:MailTo \
params email="youremail@yourdomain.com" \
params subject="Cluster Failover"
This will result in an email being sent out whenever the node is taking over resources, meaning the other one is down/failing/dead. So when you receive a mail, you'll automatically see from whom it's coming (root@hostname or something like that) and will know that there has been a 'takeover' of resources.
If I'm correct you have to set something up like this in both nodes (in the haresources file):
Code:
primitive mail ocf:heartbeat:MailTo \
params email="youremail@yourdomain.com" \
params subject="Cluster Failover"
This will result in an email being sent out whenever the node is taking over resources, meaning the other one is down/failing/dead. So when you receive a mail, you'll automatically see from whom it's coming (root@hostname or something like that) and will know that there has been a 'takeover' of resources.
Kind regards,
Eric
thanks in that case as soon as I have some time I will have to test it
Please let us know the results. Also check which mail command is used on your system and that it accepts the parameters issued by the script (-s is not always accepted according to some sites).
Have you had the time to test the solution offered yet? If you've got it working then please let us know how you fixed it so that other users can profit from that information and mark this thread as solved using the Thread tools. If it's not yet solved please let us know what errors you get so we can help you looking for an answer.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.