From: Greg Sabino Mullane Date: Sun, 28 Sep 2008 21:10:16 +0000 (-0400) Subject: Flatten error messages for Nagios one-line 'unknown' output. X-Git-Tag: 2.9.0~252 X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=028fbe423a943fdb10c274201ea589bb633332df;p=check_postgres.git Flatten error messages for Nagios one-line 'unknown' output. Avoid pipes in unknown messages if showperf is true. --- 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 {