<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: PostgreSQL 9.2 Master &#8211; Slave Monitoring	</title>
	<atom:link href="https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/feed/" rel="self" type="application/rss+xml" />
	<link>https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/</link>
	<description>Ramblings of an old-fashioned space cowboy</description>
	<lastBuildDate>Tue, 03 Oct 2017 10:09:42 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
	<item>
		<title>
		By: Bram van Dartel		</title>
		<link>https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-253102</link>

		<dc:creator><![CDATA[Bram van Dartel]]></dc:creator>
		<pubDate>Tue, 03 Oct 2017 10:09:42 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=943#comment-253102</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-253101&quot;&gt;Bram van Dartel&lt;/a&gt;.

or just...

export psql=\`which psql\`
export bc=\`which bc\`]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-253101">Bram van Dartel</a>.</p>
<p>or just&#8230;</p>
<p>export psql=\`which psql\`<br />
export bc=\`which bc\`</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Bram van Dartel		</title>
		<link>https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-253101</link>

		<dc:creator><![CDATA[Bram van Dartel]]></dc:creator>
		<pubDate>Tue, 03 Oct 2017 10:09:18 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=943#comment-253101</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-252739&quot;&gt;Johnny Morano&lt;/a&gt;.

or just...

export psql=`which psql`
export bc=`which bc`]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-252739">Johnny Morano</a>.</p>
<p>or just&#8230;</p>
<p>export psql=`which psql`<br />
export bc=`which bc`</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Chris		</title>
		<link>https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-253052</link>

		<dc:creator><![CDATA[Chris]]></dc:creator>
		<pubDate>Thu, 22 Jun 2017 22:31:11 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=943#comment-253052</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-224721&quot;&gt;emb3dd3d&lt;/a&gt;.

you need to swap your host and slave - you might have them reversed]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-224721">emb3dd3d</a>.</p>
<p>you need to swap your host and slave &#8211; you might have them reversed</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Johnny Morano		</title>
		<link>https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-252739</link>

		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Wed, 22 Jun 2016 12:43:29 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=943#comment-252739</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-252731&quot;&gt;James Jaramillo&lt;/a&gt;.

On the command line, write &#039;which psql&#039; and configure that path in the script ;)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-252731">James Jaramillo</a>.</p>
<p>On the command line, write &#8216;which psql&#8217; and configure that path in the script 😉</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: James Jaramillo		</title>
		<link>https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-252731</link>

		<dc:creator><![CDATA[James Jaramillo]]></dc:creator>
		<pubDate>Fri, 17 Jun 2016 20:22:20 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=943#comment-252731</guid>

					<description><![CDATA[Hi, when I run it, I got this error. Please help to solve it. Thanks!

My operative system is debian 

/opt/postgresql/bin/psql: No such file or directory
/opt/postgresql/bin/psql: No such file or directory
/opt/postgresql/bin/psql: No such file or directory
/opt/postgresql/bin/psql: No such file or directory]]></description>
			<content:encoded><![CDATA[<p>Hi, when I run it, I got this error. Please help to solve it. Thanks!</p>
<p>My operative system is debian </p>
<p>/opt/postgresql/bin/psql: No such file or directory<br />
/opt/postgresql/bin/psql: No such file or directory<br />
/opt/postgresql/bin/psql: No such file or directory<br />
/opt/postgresql/bin/psql: No such file or directory</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: emb3dd3d		</title>
		<link>https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-224721</link>

		<dc:creator><![CDATA[emb3dd3d]]></dc:creator>
		<pubDate>Thu, 26 Mar 2015 15:08:08 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=943#comment-224721</guid>

					<description><![CDATA[Does this work for streaming replication?..   I receive an error when trying to run.  Streaming Replication has the secondary always in recovery mode.

ERROR:  recovery is in progress
HINT:  WAL control functions cannot be executed during recovery.
CRITICAL: Stream has no value to compare (is replication configured or connectivity problem?)]]></description>
			<content:encoded><![CDATA[<p>Does this work for streaming replication?..   I receive an error when trying to run.  Streaming Replication has the secondary always in recovery mode.</p>
<p>ERROR:  recovery is in progress<br />
HINT:  WAL control functions cannot be executed during recovery.<br />
CRITICAL: Stream has no value to compare (is replication configured or connectivity problem?)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Johnny Morano		</title>
		<link>https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-213164</link>

		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Sat, 21 Feb 2015 08:23:31 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=943#comment-213164</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-212625&quot;&gt;KOJAVA&lt;/a&gt;.

Hi

Where do you have &#039;psql&#039; installed? Execute &#039;which psql&#039; to find its location, or execute &#039;locate bin/psql&#039; ;-)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-212625">KOJAVA</a>.</p>
<p>Hi</p>
<p>Where do you have &#8216;psql&#8217; installed? Execute &#8216;which psql&#8217; to find its location, or execute &#8216;locate bin/psql&#8217; 😉</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: KOJAVA		</title>
		<link>https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-212625</link>

		<dc:creator><![CDATA[KOJAVA]]></dc:creator>
		<pubDate>Fri, 20 Feb 2015 08:30:41 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=943#comment-212625</guid>

					<description><![CDATA[Hi, when I run it, I got this error. Please help to solve it. Thanks!

: No such file or directoryne 18: /usr/bin/psql
: No such file or directoryne 19: /usr/bin/psql
: No such file or directoryne 20: /usr/bin/psql
: No such file or directoryne 21: /usr/bin/psql
monitor_master_slave.sh: line 58: syntax error: unexpected end of file]]></description>
			<content:encoded><![CDATA[<p>Hi, when I run it, I got this error. Please help to solve it. Thanks!</p>
<p>: No such file or directoryne 18: /usr/bin/psql<br />
: No such file or directoryne 19: /usr/bin/psql<br />
: No such file or directoryne 20: /usr/bin/psql<br />
: No such file or directoryne 21: /usr/bin/psql<br />
monitor_master_slave.sh: line 58: syntax error: unexpected end of file</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob		</title>
		<link>https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-9970</link>

		<dc:creator><![CDATA[Rob]]></dc:creator>
		<pubDate>Wed, 30 Apr 2014 10:53:09 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=943#comment-9970</guid>

					<description><![CDATA[This script expects that you will alwasy logon as the postgres user itself, while this is not alweays the case.

I added an extra option for the user, and edited the psql commands so it will use this user instead of the static postgres user.

export p_user=$6


master_lag=$($psql -U $p_user -h$p_host -p$p_port -A -t -c &quot;SELECT pg_xlog_location_diff(pg_current_xlog_location(), &#039;0/0&#039;) AS offset&quot; $p_db)
slave_lag=$($psql -U $p_user  -h$s_host -p$s_port -A -t -c &quot;SELECT pg_xlog_location_diff(pg_last_xlog_receive_location(), &#039;0/0&#039;) AS receive&quot; $p_db)
replay_lag=$($psql -U $p_user -h$s_host -p$s_port -A -t -c &quot;SELECT pg_xlog_location_diff(pg_last_xlog_replay_location(), &#039;0/0&#039;) AS replay&quot; $p_db)
replay_timediff=$($psql -U $p_user -h$s_host -p$s_port -A -t -c &quot;SELECT NOW() - pg_last_xact_replay_timestamp() AS replication_delay&quot; $p_db)]]></description>
			<content:encoded><![CDATA[<p>This script expects that you will alwasy logon as the postgres user itself, while this is not alweays the case.</p>
<p>I added an extra option for the user, and edited the psql commands so it will use this user instead of the static postgres user.</p>
<p>export p_user=$6</p>
<p>master_lag=$($psql -U $p_user -h$p_host -p$p_port -A -t -c &#8220;SELECT pg_xlog_location_diff(pg_current_xlog_location(), &#8216;0/0&#8217;) AS offset&#8221; $p_db)<br />
slave_lag=$($psql -U $p_user  -h$s_host -p$s_port -A -t -c &#8220;SELECT pg_xlog_location_diff(pg_last_xlog_receive_location(), &#8216;0/0&#8217;) AS receive&#8221; $p_db)<br />
replay_lag=$($psql -U $p_user -h$s_host -p$s_port -A -t -c &#8220;SELECT pg_xlog_location_diff(pg_last_xlog_replay_location(), &#8216;0/0&#8217;) AS replay&#8221; $p_db)<br />
replay_timediff=$($psql -U $p_user -h$s_host -p$s_port -A -t -c &#8220;SELECT NOW() &#8211; pg_last_xact_replay_timestamp() AS replication_delay&#8221; $p_db)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: dan		</title>
		<link>https://jmorano.moretrix.com/2013/08/postgresql-9-2-master-slave-monitoring/#comment-1284</link>

		<dc:creator><![CDATA[dan]]></dc:creator>
		<pubDate>Thu, 05 Sep 2013 11:25:39 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=943#comment-1284</guid>

					<description><![CDATA[did it and it works like a charm. cheers :)]]></description>
			<content:encoded><![CDATA[<p>did it and it works like a charm. cheers 🙂</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
