diff options
author | Greg Sabino Mullane | 2011-07-12 02:23:53 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2011-07-12 02:23:53 +0000 |
commit | d21a5a1885b9886b68b7c18b70eead6819c72bcc (patch) | |
tree | a3bb0f415c18e2cf54284d1a1609bcabb28d0677 | |
parent | 87dbe3cfb40aed5e77afc7328061a8285118df9f (diff) |
Do not show connection variants for historical database.
-rwxr-xr-x | check_postgres.pl | 8 |
1 files changed, 5 insertions, 3 deletions
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)}; } |