From 913fab7bf03746d7958b5c0630683c6a2965b5ea Mon Sep 17 00:00:00 2001 From: Michael Renner Date: Wed, 3 Apr 2013 12:40:39 +0200 Subject: bloat query: fix totalwastedbytes totalwastedbytes returned only the number of wasted pages - fix that by multiplying with the blocksize --- check_postgres.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'check_postgres.pl') diff --git a/check_postgres.pl b/check_postgres.pl index a3078f40d..246025e99 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -3531,9 +3531,9 @@ SELECT CASE WHEN ipages < iotta THEN 0 ELSE bs*(ipages-iotta) END AS wastedibytes, CASE WHEN ipages < iotta THEN '0 bytes' ELSE (bs*(ipages-iotta))::bigint || ' bytes' END AS wastedisize, CASE WHEN relpages < otta THEN - CASE WHEN ipages < iotta THEN 0 ELSE ipages-iotta::bigint END - ELSE CASE WHEN ipages < iotta THEN relpages-otta::bigint - ELSE relpages-otta::bigint + ipages-iotta::bigint END + CASE WHEN ipages < iotta THEN 0 ELSE bs*(ipages-iotta::bigint) END + ELSE CASE WHEN ipages < iotta THEN bs*(relpages-otta::bigint) + ELSE bs*(relpages-otta::bigint + ipages-iotta::bigint) END END AS totalwastedbytes FROM ( SELECT -- cgit v1.2.3 From 2aa4a119cc52b33d2ae226640a617c4ddb582c9e Mon Sep 17 00:00:00 2001 From: Michael Renner Date: Wed, 11 Jun 2014 17:10:33 +0200 Subject: fix & extend hot_standby_delay documentation This should also account for all places where the refactoring of the numbered dbparameters (host2, port2, etc.) was referenced in the documentation. Drop the TODO entry. --- TODO | 2 -- check_postgres.pl | 17 ++++++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'check_postgres.pl') 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 d3c55815e..0314c5599 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -8812,15 +8812,14 @@ and the name of the database on the fourth line. =head2 B (C) 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. 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 xlog -location. These values should match the volume of transactions needed to have the streaming -replication disconnect from the master because of too much lag. - -You must provide information on how to reach the second database by a connection -parameter ending in the number 2, such as "--dbport2=5543". If if it not given, -the action fails. +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 first "--dbname", "--host", and "--port", etc. options are considered the +master; the second belongs to the slave. =head2 B -- cgit v1.2.3