From: Greg Sabino Mullane Date: Tue, 12 Jul 2011 02:23:53 +0000 (-0400) Subject: Do not show connection variants for historical database. X-Git-Tag: 2.18.0~16 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=d21a5a1885b9886b68b7c18b70eead6819c72bcc;p=check_postgres.git Do not show connection variants for historical database. --- diff --git a/check_postgres.pl b/check_postgres.pl index 41e0aec3e..074761c1b 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -1348,9 +1348,11 @@ sub add_response { ## Pretty display of what exactly those numbers mean! my $number = 0; + my $historical = 0; for my $row (@targetdb) { $number++; if (exists $row->{filename}) { + $historical = 1; $same_schema_header .= sprintf "\nDB %s: File=%s\nDB %s: %s: %s %s: %s", $number, $row->{filename}, @@ -1373,21 +1375,21 @@ sub add_response { ## Databases $number = 1; my %dlist = map { $_->{dbname}, $number++; } @targetdb; - if (keys %dlist > 1) { + if (keys %dlist > 1 and ! $historical) { my $dblist = join ',' => sort { $dlist{$a} <=> $dlist{$b} } keys %dlist; $dbname = qq{ (databases:$dblist)}; } ## Hosts $number = 1; my %hostlist = map { $_->{host}, $number++; } @targetdb; - if (keys %hostlist > 1) { + if (keys %hostlist > 1 and ! $historical) { my $dblist = join ',' => sort { $hostlist{$a} <=> $hostlist{$b} } keys %hostlist; $dbhost = qq{ (hosts:$dblist)}; } ## Ports $number = 1; my %portlist = map { $_->{port}, $number++; } @targetdb; - if (keys %portlist > 1) { + if (keys %portlist > 1 and ! $historical) { my $dblist = join ',' => sort { $portlist{$a} <=> $portlist{$b} } keys %portlist; $dbport = qq{ (ports:$dblist)}; }