Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 037D015C4CC7 for ; Thu, 2 Aug 2012 00:23:02 -0300 (ADT) Received: from wsip-70-169-168-7.pn.at.cox.net ([70.169.168.7] helo=FS.denninger.net) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Swm04-0001PK-Bw for pgsql-general@postgresql.org; Thu, 02 Aug 2012 03:23:02 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by FS.denninger.net (8.14.4/8.13.1) with ESMTP id q723Mktn020276 for ; Wed, 1 Aug 2012 22:22:46 -0500 (CDT) (envelope-from karl@denninger.net) Received: from [127.0.0.1] [192.168.1.40] by Spamblock-sys (LOCAL); Wed Aug 1 22:22:46 2012 Message-ID: <5019F281.8070109@denninger.net> Date: Wed, 01 Aug 2012 22:22:41 -0500 From: Karl Denninger User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: richter@simkorp.com.br CC: pgsql-general@postgresql.org Subject: Re: Async replication: how to get an alert on failure References: <5019ADE5.4050800@simkorp.com.br> In-Reply-To: <5019ADE5.4050800@simkorp.com.br> X-Enigmail-Version: 1.4.3 Content-Type: multipart/alternative; boundary="------------000707080108040406060304" X-Antivirus: avast! (VPS 120801-1, 08/01/2012), Outbound message X-Antivirus-Status: Clean X-Pg-Spam-Score: 0.5 (/) X-Archive-Number: 201208/21 X-Sequence-Number: 189198 This is a multi-part message in MIME format. --------------000707080108040406060304 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by FS.denninger.net id q723Mktn020276 On 8/1/2012 5:29 PM, Edson Richter wrote: > I have few PostgreSQL servers established with replication. > Now, is there any way to receive an e-mail in case of error during > synchronization? > I mean, is there an script I can run (maybe every 5 minutes) that will > check if replication is stolen, and send an e-mail in case of failure? > > Thanks, > --=20 I wrote a small program that goes to each of the servers in the replication group and checks its status on the log, computes the difference, and if off by more than "X" bytes prints a notification. If this is run from the cron it will remain silent unless the offset is breached at which point it will emit an email to the submitting owner of the job. --=20 -- Karl Denninger /The Market Ticker =AE/ Cuda Systems LLC --------------000707080108040406060304 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 8/1/2012 5:29 PM, Edson Richter wrote:
I have few PostgreSQL servers established with replication.
Now, is there any way to receive an e-mail in case of error during synchronization?
I mean, is there an script I can run (maybe every 5 minutes) that will check if replication is stolen, and send an e-mail in case of failure?

Thanks,
--

I wrote a small program that goes to each of the servers in the replication group and checks its status on the log, computes the difference, and if off by more than "X" bytes prints a notification.

If this is run from the cron it will remain silent unless the offset is breached at which point it will emit an email to the submitting owner of the job.

--
-- Karl Denninger
The Market Ticker ®
Cuda Systems LLC
--------------000707080108040406060304--