summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl15
1 files changed, 15 insertions, 0 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index b5ff62de4..085d079bb 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -1932,6 +1932,12 @@ sub run_command {
}
if ($db->{error} =~ /FATAL/) {
+ ## If we are just trying to connect, this should be a normal error
+ if ($action eq 'connection') {
+ $info->{fatal} = 1;
+ return $info;
+ }
+
if (exists $arg->{fatalregex} and $db->{error} =~ /$arg->{fatalregex}/) {
$info->{fatalregex} = $db->{error};
next;
@@ -3079,6 +3085,12 @@ sub check_connection {
$db = $info->{db}[0];
+ if (exists $info->{fatal}) {
+ $MRTG and do_mrtg({one => 0});
+ add_critical $db->{error};
+ return;
+ }
+
my $ver = ($db->{slurp}[0]{v} =~ /(\d+\.\d+\S+)/o) ? $1 : '';
$MRTG and do_mrtg({one => $ver ? 1 : 0});
@@ -8751,6 +8763,9 @@ Items not specifically attributed are by Greg Sabino Mullane.
Fix problem when examining items in pg_settings (Greg Sabino Mullane)
+ For connection test, return critical, not unknown, on FATAL errors
+ (Greg Sabino Mullane, reported by Peter Eisentraut in bug #62)
+
=item B<Version 2.15.0>
Add --quiet argument to surpress output on OK Nagios results