summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
authorChristoph Berg2014-09-08 15:05:35 +0000
committerChristoph Berg2014-09-08 15:05:35 +0000
commitd14c46ba4529c2c5b6b3e3abd625e422cade2b96 (patch)
tree5761a3a94bfa867800d69e37da21c7bbd59c974b /check_postgres.pl
parentba8131278add03eb53ac539d22bdbde8c413b350 (diff)
Fix bloat check to use correct SQL depending on the server version.
Previously it used the psql version which might differ when multiple versions are installed locally, or when querying remote servers. The hot_standby_delay check is also affected, but more involved to fix, so leave that for later. Adrian Vondendriesch
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl13
1 files changed, 6 insertions, 7 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index 60e86c3b3..2e6eb7a4e 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -3623,14 +3623,10 @@ FROM (
## Alternate versions for old versions
my $SQL2 = $SQL;
- if ($psql_version <= 8.4) {
- $SQL2 =~ s/AND s.inherited=false//;
- }
+ $SQL2 =~ s/AND s.inherited=false//; # 8.4 and earlier
my $SQL3 = $SQL2;
- if ($psql_version <= 7.4) {
- $SQL3 =~ s/SELECT current_setting.+?AS bs/(SELECT 8192) AS bs/;
- }
+ $SQL3 =~ s/SELECT current_setting.+?AS bs/(SELECT 8192) AS bs/; # 7.4 and earlier
my $info = run_command($SQL, { version => [ "<8.0 $SQL3", "<9.0 $SQL2" ] } );
@@ -4759,7 +4755,7 @@ sub check_hot_standby_delay {
## --warning='1048576 and 2min' --critical='16777216 and 10min'
my ($warning, $wtime, $critical, $ctime) = validate_integer_for_time({default_to_int => 1});
- if ($psql_version < 9.1 and (length $wtime or length $ctime)) {
+ if ($psql_version < 9.1 and (length $wtime or length $ctime)) { # FIXME: check server version instead
add_unknown msg('hs-time-version');
return;
}
@@ -9821,6 +9817,9 @@ Items not specifically attributed are by GSM (Greg Sabino Mullane).
=item B<Version 2.21.1>
+ Fix bloat check to use correct SQL depending on the server version.
+ (Adrian Vondendriesch)
+
Add explicit ORDER BY to the slony_status check to get the most lagged server.
(Jeff Frost)