diff options
author | Greg Sabino Mullane | 2009-04-23 19:30:34 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2009-04-23 19:30:34 +0000 |
commit | 7651d8150336f55c467a959d079f6d3c54b56ffd (patch) | |
tree | e9ff98011ef995b6a39eecef954de170fa426ce3 /check_postgres.pl | |
parent | 2726603903fcde5a7f07f6a4604a26732e0a1e66 (diff) |
Fixed for new_version_pg, plus a test for it.
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-x | check_postgres.pl | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/check_postgres.pl b/check_postgres.pl index 235f42113..173ddad24 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -147,8 +147,8 @@ our %msg = ( 'new-pg-badver' => q{Could not determine the Postgres revision (version was $1)}, 'new-pg-badver2' => q{Could not find revision information for Postgres version $1}, 'new-pg-big' => q{Please upgrade to version $1 of Postgres. You are running $2}, - 'new-pg-small' => q{The latest version of Postgres is $1, but you are runnning $2?}, - 'new-pg-match' => q{Postgres is at the latest revsion ($1)}, + 'new-pg-small' => q{The latest version of Postgres is $1, but you are running $2?}, + 'new-pg-match' => q{Postgres is at the latest revision ($1)}, 'no-match-db' => q{No matching databases found due to exclusion/inclusion options}, 'no-match-fs' => q{No matching file systems found due to exclusion/inclusion options}, 'no-match-rel' => q{No matching relations found due to exclusion/inclusion options}, @@ -4488,14 +4488,16 @@ sub check_new_version_pg { } my $newrev = $newver{$ver}; if ($newrev > $rev) { - printf "WARNING: %s\n", msg('new-pg-big', "$ver.$newrev", $currver); - exit 1; + my $msg = sprintf "WARNING: %s\n", msg('new-pg-big', "$ver.$newrev", $currver); + add_warning $msg; + } + elsif ($newrev < $rev) { + my $msg = sprintf "WARNING: %s\n", msg('new-pg-small', "$ver.$newrev", $currver); + add_critical $msg; } - if ($newrev < $rev) { - printf "WARNING: %s\n", msg('new-pg-small', "$ver.$newrev", $currver); - exit 1; + else { + add_ok msg('new-pg-match', $currver); } - add_ok msg('new-pg-match', $currver); } return; |