From 20e4f6b5ea8085e7bf456b9767f562bc36a44ba4 Mon Sep 17 00:00:00 2001 From: Nicolas Marchildon Date: Tue, 7 Jul 2009 12:52:23 -0400 Subject: [PATCH] CRITICAL when hitting an error such as 'FATAL: sorry, too many clients already' --- check_postgres.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/check_postgres.pl b/check_postgres.pl index 9c8a3d2f..3ae717c4 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -749,8 +749,9 @@ sub ndie { eval { File::Temp::cleanup(); }; my $msg = shift; chomp $msg; - print "ERROR: $msg\n"; - exit 3; + add_critical("ERROR: $msg"); + finishup(); + exit 2; } sub msg { ## no critic