From richter@simkorp.com.br Wed Aug 1 22:30:18 2012 Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 4B219DA629C for ; Wed, 1 Aug 2012 19:30:18 -0300 (ADT) Received: from smtp151.uni5.net ([189.38.92.151]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SwhQl-0008RE-Uk for pgsql-general@postgresql.org; Wed, 01 Aug 2012 22:30:17 +0000 Received: from smtp-gw-01.uni5.net (smtp-gw-01 [127.0.0.1]) by smtp151.uni5.net (Postfix) with ESMTP id B4511408BD for ; Wed, 1 Aug 2012 19:30:00 -0300 (BRT) Received: from [192.168.0.101] (unknown [201.21.90.116]) by smtp-gw-01.uni5.net (Postfix) with ESMTPA id 9C080C90712E9 for ; Wed, 1 Aug 2012 19:30:00 -0300 (BRT) Message-ID: <5019ADE5.4050800@simkorp.com.br> Date: Wed, 01 Aug 2012 19:29:57 -0300 From: Edson Richter Reply-To: richter@simkorp.com.br User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Async replication: how to get an alert on failure Content-Type: multipart/alternative; boundary="------------000002010705040808080002" X-Pg-Spam-Score: -0.4 (/) X-Archive-Number: 201208/19 X-Sequence-Number: 189196 This is a multi-part message in MIME format. --------------000002010705040808080002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable I have few PostgreSQL servers established with replication. Now, is there any way to receive an e-mail in case of error during=20 synchronization? I mean, is there an script I can run (maybe every 5 minutes) that will=20 check if replication is stolen, and send an e-mail in case of failure? Thanks, --=20 *Edson Carlos Ericksson Richter* /SimKorp Inform=E1tica Ltda/ Fone: (51) 3366-7964 Celular: (51)9318-9766/(51) 8585-0796 Embedded Image --------------000002010705040808080002 Content-Type: multipart/related; boundary="------------020706010405080107010404" --------------020706010405080107010404 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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,
--

Edson Carlos Ericksson Richter
SimKorp Informática Ltda
Fone: (51) 3366-7964
Celular: (51)9318-9766/(51) 8585-0796
Embedded Image

--------------020706010405080107010404 Content-Type: image/png; name="cfgfcdef.png" Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: inline; filename="cfgfcdef.png" /9j/4AAQSkZJRgABAAEBLAEsAAD//gAfTEVBRCBUZWNobm9sb2dpZXMgSW5j LiBWMS4wMQD/2wCEAAUFBQgFCAwHBwwMCQkJDA0MDAwMDQ0NDQ0NDQ0NDQ0N DQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0BBQgICgcKDAcHDA0M CgwNDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0N DQ0NDQ0NDf/EAaIAAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKCwEAAwEB AQEBAQEBAQAAAAAAAAECAwQFBgcICQoLEAACAQMDAgQDBQUEBAAAAX0BAgMA BBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygp KjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaH iImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX 2Nna4eLj5OXm5+jp6vHy8/T19vf4+foRAAIBAgQEAwQHBQQEAAECdwABAgMR BAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJico KSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWG h4iJipKTlJWWl5iZmqKjpK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biRMyttVhs3eXGhiZjJG843kK n7zqj/F/uf0pz/eH/Af/AEJaYHGJr2sMXZrURRI6cmKViIpWARgqOWkeMHfI iLyuQ5gdShiTxFrTpzZFH/e5zFIQhjhkK8CTLiWYRqhUg48wFQPLlfuW+6fo KX1/z60AcbNrmrRb0FtkpJIiv5M21xtkMJVQxIEjRFHLOFi86FiSMg+cftFN dz6Fb6fYwzTtc3atIIo3kxHFG5+YIDjMjRkZ9K95P9R/OuG8e/ct/wDek/kt IZ4V+zZ4ZurC61DUb2CW2KxRW8fmxvGWDu0km0OASB5Ueceor61rgvAf+pn/ AN9f/QTXe0bAFFFFMR//2Q== --------------020706010405080107010404-- --------------000002010705040808080002-- From edsonrichter@hotmail.com Thu Aug 2 00:04:28 2012 Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id BC97DDA629C for ; Wed, 1 Aug 2012 21:04:28 -0300 (ADT) Received: from blu0-omc2-s30.blu0.hotmail.com ([65.55.111.105]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Switt-0006MF-JF for pgsql-general@postgresql.org; Thu, 02 Aug 2012 00:04:27 +0000 Received: from BLU0-SMTP362 ([65.55.111.71]) by blu0-omc2-s30.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 1 Aug 2012 17:04:10 -0700 X-Originating-IP: [201.21.90.116] X-Originating-Email: [edsonrichter@hotmail.com] Message-ID: Received: from [192.168.0.101] ([201.21.90.116]) by BLU0-SMTP362.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 1 Aug 2012 17:04:07 -0700 Date: Wed, 1 Aug 2012 21:04:01 -0300 From: Edson Richter Organization: Simkorp =?ISO-8859-1?Q?Inform=E1tica_Ltda?= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Async replication: how to get an alert on failure References: <5019ADE5.4050800@simkorp.com.br> In-Reply-To: <5019ADE5.4050800@simkorp.com.br> X-Forwarded-Message-Id: <5019ADE5.4050800@simkorp.com.br> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 02 Aug 2012 00:04:07.0864 (UTC) FILETIME=[561F0B80:01CD7042] X-Pg-Spam-Score: -0.5 (/) X-Archive-Number: 201208/14 X-Sequence-Number: 189191 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 (cron?) I can run (maybe every 5 minutes) that will check if replication is stolen, and send an e-mail in case of failure? Thanks, Edson Richter From toby.corkindale@strategicdata.com.au Thu Aug 2 02:50:22 2012 Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id A7463CED706 for ; Wed, 1 Aug 2012 23:50:22 -0300 (ADT) Received: from na3sys009aog111.obsmtp.com ([74.125.149.205]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1SwlUQ-0000eN-ET for pgsql-general@postgresql.org; Thu, 02 Aug 2012 02:50:21 +0000 Received: from sdcarl02.strategicdata.com.au ([203.214.67.82]) (using TLSv1) by na3sys009aob111.postini.com ([74.125.148.12]) with SMTP ID DSNKUBnq2jPkS0k+HE2mP7Dp3hjAyvro1VVt@postini.com; Wed, 01 Aug 2012 19:50:18 PDT Received: from [192.168.1.162] (adonai.mel.strategicdata.com.au [192.168.1.162]) by fitz-mail01.strategicdata.internal (Postfix) with ESMTP id 08E5F380D32 for ; Thu, 2 Aug 2012 12:50:00 +1000 (EST) Message-ID: <5019EAD8.9090908@strategicdata.com.au> Date: Thu, 02 Aug 2012 12:50:00 +1000 From: Toby Corkindale User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Re: Async replication: how to get an alert on failure References: <5019ADE5.4050800@simkorp.com.br> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201208/17 X-Sequence-Number: 189194 On 02/08/12 10:04, 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 (cron?) I can run (maybe every 5 minutes) > that will check if replication is stolen, and send an e-mail in case of > failure? I created a little Perl script that just connects to the master and queries the pg_stat_replication statistics. It notes if (a) the client has disconnected entirely, or (b) if the client's replay position has still not reached the position that the master was in last time we checked. (So if you run the check every five minutes, you'll get a warning if the client is more than five minutes lagged behind the master) From karl@denninger.net Thu Aug 2 03:23:02 2012 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-- From edsonrichter@hotmail.com Fri Aug 3 11:12:52 2012 Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id B9BFD930E1E for ; Fri, 3 Aug 2012 08:12:52 -0300 (ADT) Received: from blu0-omc2-s35.blu0.hotmail.com ([65.55.111.110]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SxFoH-0000Aq-CC for pgsql-general@postgresql.org; Fri, 03 Aug 2012 11:12:52 +0000 Received: from BLU0-SMTP426 ([65.55.111.72]) by blu0-omc2-s35.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 3 Aug 2012 04:12:34 -0700 X-Originating-IP: [201.21.90.116] X-Originating-Email: [edsonrichter@hotmail.com] Message-ID: Received: from [192.168.0.101] ([201.21.90.116]) by BLU0-SMTP426.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 3 Aug 2012 04:12:31 -0700 Date: Fri, 3 Aug 2012 08:12:23 -0300 From: Edson Richter Organization: Simkorp =?ISO-8859-1?Q?Inform=E1tica_Ltda?= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Karl Denninger CC: pgsql-general@postgresql.org Subject: Re: Async replication: how to get an alert on failure References: <5019ADE5.4050800@simkorp.com.br> <5019F281.8070109@denninger.net> In-Reply-To: <5019F281.8070109@denninger.net> Content-Type: multipart/alternative; boundary="------------090300010905030702010007" X-OriginalArrivalTime: 03 Aug 2012 11:12:31.0353 (UTC) FILETIME=[E0139690:01CD7168] X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/44 X-Sequence-Number: 189221 --------------090300010905030702010007 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 8bit Em 02/08/2012 00:22, Karl Denninger escreveu: > 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 Can you please share the query are you using so I can have a start point? Thanks, Edson --------------090300010905030702010007 Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit
Em 02/08/2012 00:22, Karl Denninger escreveu:
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

Can you please share the query are you using so I can have a start point?

Thanks,

Edson


--------------090300010905030702010007-- From pavan.postgresdba@gmail.com Thu Sep 6 06:17:49 2018 Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fxnc2-0006HM-Va for pgsql-general@arkaria.postgresql.org; Thu, 06 Sep 2018 06:17:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fxnc1-0007gM-7C for pgsql-general@arkaria.postgresql.org; Thu, 06 Sep 2018 06:17:53 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fxnc0-0007g9-S7 for pgsql-general@lists.postgresql.org; Thu, 06 Sep 2018 06:17:53 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fxnby-0000r1-8x for pgsql-general@postgresql.org; Thu, 06 Sep 2018 06:17:51 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 35FD3EF9C24F for ; Wed, 5 Sep 2018 23:17:49 -0700 (MST) Date: Wed, 5 Sep 2018 23:17:49 -0700 (MST) From: pavan95 To: pgsql-general@postgresql.org Message-ID: <1536214669218-0.post@n3.nabble.com> In-Reply-To: <5019F281.8070109@denninger.net> References: <5019ADE5.4050800@simkorp.com.br> <5019F281.8070109@denninger.net> Subject: Re: Async replication: how to get an alert on failure MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Karl, Hope my mail finds you in good time. >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. Did you configure ssh ?? >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. Could you please share your views on how to achieve it? Thanks in Advance. Regards, Pavan -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html