LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 05-03-2010, 02:02 PM   #1
kopper27
Member
 
Registered: Nov 2009
Posts: 132

Rep: Reputation: 16
Linux-Heartbeat Email Notification


hi guys

I hope this goes here

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

thanks a lot
 
Old 05-04-2010, 01:06 AM   #2
EricTRA
Guru
 
Registered: May 2009
Location: Barcelona, Spain
Distribution: LMDE Gnome with Awesome WM + Kernel 3.3.0-1 amd64
Posts: 6,529
Blog Entries: 1

Rep: Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220
Hello,

I think you're looking for this:
MailTo HeartBeat

Kind regards,

Eric
 
Old 05-04-2010, 11:51 AM   #3
karlochacon
Member
 
Registered: Dec 2006
Posts: 99

Rep: Reputation: 17
sorry wrong post

Last edited by karlochacon; 05-04-2010 at 11:53 AM.
 
Old 05-04-2010, 11:58 AM   #4
kopper27
Member
 
Registered: Nov 2009
Posts: 132

Original Poster
Rep: Reputation: 16
doing more research looks like adding this

Code:
MailTo::name1@some.com,another@bla.org

to

Code:
/etc/ha.d/haresources

works?

can someone tell me if it is that simple?

thanks a lot

Last edited by kopper27; 05-04-2010 at 11:59 AM.
 
Old 05-04-2010, 02:03 PM   #5
EricTRA
Guru
 
Registered: May 2009
Location: Barcelona, Spain
Distribution: LMDE Gnome with Awesome WM + Kernel 3.3.0-1 amd64
Posts: 6,529
Blog Entries: 1

Rep: Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220
Hi,

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
 
Old 05-04-2010, 02:29 PM   #6
kopper27
Member
 
Registered: Nov 2009
Posts: 132

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by EricTRA View Post
Hi,

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
 
Old 05-04-2010, 02:33 PM   #7
EricTRA
Guru
 
Registered: May 2009
Location: Barcelona, Spain
Distribution: LMDE Gnome with Awesome WM + Kernel 3.3.0-1 amd64
Posts: 6,529
Blog Entries: 1

Rep: Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220
Hi,

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).

Kind regards,

Eric
 
Old 05-14-2010, 06:16 AM   #8
EricTRA
Guru
 
Registered: May 2009
Location: Barcelona, Spain
Distribution: LMDE Gnome with Awesome WM + Kernel 3.3.0-1 amd64
Posts: 6,529
Blog Entries: 1

Rep: Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220Reputation: 1220
Hi kopper27,

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.

Kind regards,

Eric
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Thunderbird Taskbar Email Notification in Linux? JET-33 Linux - General 4 01-16-2007 11:27 PM
email notification mbegovic LQ Suggestions & Feedback 6 04-01-2004 12:36 PM
Email notification for linux? reesee Linux - General 2 03-02-2004 06:30 PM
Email Notification ezra143 LQ Suggestions & Feedback 6 01-12-2004 10:17 AM
Email notification jeremy LQ Suggestions & Feedback 6 11-07-2002 01:16 PM


All times are GMT -5. The time now is 06:06 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration