Cleaner "ERROR" output
authorGreg Sabino Mullane <[email protected]>
Mon, 20 Feb 2012 20:27:32 +0000 (15:27 -0500)
committerGreg Sabino Mullane <[email protected]>
Mon, 20 Feb 2012 20:27:32 +0000 (15:27 -0500)
check_postgres.pl

index 9a0746214de062f623b4f8833b2a60cddd65c30f..4fc3c00053f27de0ba889627559e2f4d77d2ccf4 100755 (executable)
@@ -1271,6 +1271,10 @@ sub ndie {
     eval { File::Temp::cleanup(); };
     my $msg = shift;
     chomp $msg;
+    ## If this message already starts with an ERROR, filter that out for prettiness
+    $msg =~ s/^\s*ERROR:\s*/ /;
+    ## Trim whitespace
+    $msg =~ s/^\s*(.+)\s*$/$1/;
     print "ERROR: $msg\n";
     exit 3;
 }