From 028fbe423a943fdb10c274201ea589bb633332df Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Sun, 28 Sep 2008 17:10:16 -0400 Subject: [PATCH] Flatten error messages for Nagios one-line 'unknown' output. Avoid pipes in unknown messages if showperf is true. --- check_postgres.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/check_postgres.pl b/check_postgres.pl index 9599eeb49..96670ab93 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -351,6 +351,8 @@ sub add_response { sub add_unknown { my $msg = shift || $db->{error}; + $msg =~ s/[\r\n]\s*/\\n /g; + $msg =~ s/\|//g if $opt{showperf}; add_response \%unknown, $msg; } sub add_critical { -- 2.39.5