summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
authorGreg Sabino Mullane2009-04-27 22:51:01 +0000
committerGreg Sabino Mullane2009-04-27 22:51:01 +0000
commit13bc08a5ee4babf48d2181cf0e28f69f174933c4 (patch)
tree9c01225099ca044d2a75eca5d55d8c771e38885a /check_postgres.pl
parent9ede7dc4dda081de41e4ba60a28342e63e66d811 (diff)
Better handling of mismatched pg_controldata versions.
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl18
1 files changed, 18 insertions, 0 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index c10bde63f..06a934dde 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -93,6 +93,9 @@ our %msg = (
'bloat-nomin' => q{no relations meet the minimum bloat criteria},
'bloat-table' => q{table $1.$2 rows:$3 pages:$3 shouldbe:$4 ($5X) wasted size:$6 ($7)},
'checkpoint-baddir' => q{Invalid data_directory: "$1"},
+ 'checkpoint-baddir2' => q{pg_controldata could not read the given data directory: "$1"},
+ 'checkpoint-badver' => q{Failed to run pg_controldata - probably the wrong version},
+ 'checkpoint-badver2' => q{Failed to run pg_controldata - is it the correct version?},
'checkpoint-nodir' => q{Must supply a --datadir argument or set the PGDATA environment variable},
'checkpoint-nodp' => q{Must install the Perl module Date::Parse to use the checkpoint action},
'checkpoint-noregex' => q{Call to pg_controldata $1 failed},
@@ -279,6 +282,9 @@ our %msg = (
'bloat-nomin' => q{aucune relation n'atteint le critère minimum de fragmentation},
'bloat-table' => q{table $1.$2 lignes:$3 pages:$3 devrait être:$4 ($5X) place perdue:$6 ($7)},
'checkpoint-baddir' => q{data_directory invalide : "$1"},
+'checkpoint-baddir2' => q{pg_controldata could not read the given data directory: "$1"},
+'checkpoint-badver' => q{Failed to run pg_controldata - probably the wrong version},
+'checkpoint-badver2' => q{Failed to run pg_controldata - is it the correct version?},
'checkpoint-nodir' => q{Vous devez fournir un argument --datadir ou configurer la variable d'environnement PGDATA},
'checkpoint-nodp' => q{Vous devez installer le module Perl Date::Parse pour utiliser l'action checkpoint},
'checkpoint-noregex' => q{Échec de l'appel à pg_controldata $1},
@@ -4362,6 +4368,18 @@ sub check_checkpoint {
ndie msg('checkpoint-nosys', $@);
}
+ ## If the path is echoed back, we most likely have an invalid data dir
+ if ($res =~ /$dir/) {
+ ndie msg('checkpoint-baddir2');
+ }
+
+ if ($res =~ /WARNING: Calculated CRC checksum/) {
+ ndie msg('checkpoint-badver');
+ }
+ if ($res !~ /^pg_control.+\d+/) {
+ ndie msg('checkpoint-badver2');
+ }
+
## See pgsql/src/bin/pg_controldata/po/*
my $regex = msg('checkpoint-regex');
if ($res !~ /$regex\s*(.+)/) { ## no critic (ProhibitUnusedCapture)