[check_postgres] [commit] Flatten error messages for Nagios
one-line 'unknown' output.
check_postgres at bucardo.org
check_postgres at bucardo.org
Mon Sep 29 01:29:10 UTC 2008
Committed by Greg Sabino Mullane <greg at endpoint.com>
Flatten error messages for Nagios one-line 'unknown' output.
Avoid pipes in unknown messages if showperf is true.
---
check_postgres.pl | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/check_postgres.pl b/check_postgres.pl
index 9599eeb..96670ab 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/\|/<PIPE>/g if $opt{showperf};
add_response \%unknown, $msg;
}
sub add_critical {
--
1.5.5.4
More information about the Check_postgres
mailing list