stefalee / mysql-master-ha

Automatically exported from code.google.com/p/mysql-master-ha
0 stars 0 forks source link

send_report documentation needs a fix #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Current documentation does not include "$conf" parameter which generates error 
during sending email notification.

Proposed code for (MHA Manager package)/samples/scripts/send_report script.

my ( $dead_master_host, $new_master_host, $new_slave_hosts, $conf, $subject, 
$body );

GetOptions(
  'orig_master_host=s' => \$dead_master_host,
  'new_master_host=s'  => \$new_master_host,
  'new_slave_hosts=s'  => \$new_slave_hosts,
  'conf=s'             => \$conf,
  'subject=s'          => \$subject,
  'body=s'             => \$body,
);

Original issue reported on code.google.com by ashok.ji...@gmail.com on 13 Oct 2011 at 6:47

GoogleCodeExporter commented 9 years ago
I too Came across this & the suggested does get rid of the error but still i am 
not able to get a email report.

I am not sure where to configure the email id to send the report to.

May be as in the comments section of this script it is incomplete & some perl 
code might be added to it to get it working

Original comment by santhi.b...@basekit.com on 2 Nov 2011 at 10:08

GoogleCodeExporter commented 9 years ago
You can send email by adding the below lines:

my $emails='youremail@company.om';
system("echo '$body' | mail -s '$subject' '$emails'");

Hope this will help.

Original comment by ashok.ji...@gmail.com on 3 Nov 2011 at 11:11

GoogleCodeExporter commented 9 years ago
Sorry for late reply.

$conf is not passed to report_script. 

my ( $dead_master_host, $new_master_host, $new_slave_hosts, $subject, $body );
GetOptions(
  'orig_master_host=s' => \$dead_master_host,
  'new_master_host=s'  => \$new_master_host,
  'new_slave_hosts=s'  => \$new_slave_hosts,
  'subject=s'          => \$subject,
  'body=s'             => \$body,
);

You can send e-mails as Ashok says.

Original comment by Yoshinor...@gmail.com on 8 Nov 2011 at 9:53