summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Sabino Mullane2014-07-03 11:22:39 +0000
committerGreg Sabino Mullane2014-07-03 11:22:39 +0000
commitfada3d6281110bdbe17aa8811d300102fcd5fe0f (patch)
treed278e4816fcab8979d50730212c88ef073569b67
parenta2373c12dfc4212e4ad4fcff08062770dffaa67f (diff)
parent2aa4a119cc52b33d2ae226640a617c4ddb582c9e (diff)
Merge branch 'master' of https://github.com/terrorobe/check_postgres
Conflicts: check_postgres.pl
-rw-r--r--TODO2
-rwxr-xr-xcheck_postgres.pl13
-rw-r--r--t/02_autovac_freeze.t1
-rw-r--r--t/02_txn_idle.t7
4 files changed, 13 insertions, 10 deletions
diff --git a/TODO b/TODO
index 570155050..bd0e61c0d 100644
--- a/TODO
+++ b/TODO
@@ -2,8 +2,6 @@ Quick list of outstanding items / bugs / feature requests for CP:
NOTE: All bugzilla items are now on github
-* Fix up references to dbhost2 and the like, or make them work again for backwards compatibility.
-
* The same_schema action does not check indexes. See bugzilla #54
* Perform automatic creation of views and function to allow all actions to be run
diff --git a/check_postgres.pl b/check_postgres.pl
index 9759f1c77..f3de959b8 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -8848,13 +8848,14 @@ and the name of the database on the fourth line.
=head2 B<hot_standby_delay>
(C<symlink: check_hot_standby_delay>) Checks the streaming replication lag by computing the delta
-between the xlog position of a master server and the one of the slaves connected to it, and/or the
-last transaction timestamp received by the slave. The slave server must be in hot_standby (e.g. read
-only) mode, therefore the minimum version to use this action is Postgres 9.0. To support transaction
-timestamps the minimum version is Postgres 9.1.
+between the current xlog position of a master server and the replay location of a slave connected
+to it. The slave server must be in hot_standby (e.g. read only) mode, therefore the minimum version to use
+this action is Postgres 9.0. The I<--warning> and I<--critical> options are the delta between the xlog
+locations. Since these values are byte offsets in the WAL they should match the expected transaction volume
+of your application to prevent false postives or negatives.
-The I<--warning> and I<--critical> options are either the delta between xlog positions in bytes,
-units of time to compare timestamps, or both.
+The first "--dbname", "--host", and "--port", etc. options are considered the
+master; the second belongs to the slave.
Byte values should be based on the volume of transactions needed to have the streaming replication
disconnect from the master because of too much lag, determined by the Postgres configuration variable
diff --git a/t/02_autovac_freeze.t b/t/02_autovac_freeze.t
index f68b9e3fd..26cfbc08e 100644
--- a/t/02_autovac_freeze.t
+++ b/t/02_autovac_freeze.t
@@ -15,6 +15,7 @@ use vars qw/$dbh $result $t $host $dbname/;
my $cp = CP_Testing->new( {default_action => 'autovac_freeze'} );
$dbh = $cp->test_database_handle();
+
$dbh->{AutoCommit} = 1;
$dbname = $cp->get_dbname;
$host = $cp->get_host();
diff --git a/t/02_txn_idle.t b/t/02_txn_idle.t
index 598cc5619..89e50f681 100644
--- a/t/02_txn_idle.t
+++ b/t/02_txn_idle.t
@@ -10,14 +10,17 @@ use Test::More tests => 15;
use lib 't','.';
use CP_Testing;
-use vars qw/$dbh $result $t $host $dbname/;
+use vars qw/$dbh $result $t $port $host $dbname/;
my $cp = CP_Testing->new( {default_action => 'txn_idle'} );
$dbh = $cp->test_database_handle();
$dbh->{AutoCommit} = 1;
-$dbname = $cp->get_dbname;
+$port = $cp->get_port();
$host = $cp->get_host();
+$dbname = $cp->get_dbname;
+
+diag "Connected as $port:$host:$dbname\n";
my $S = q{Action 'txn_idle'};
my $label = 'POSTGRES_TXN_IDLE';