Do not show connection variants for historical database.
authorGreg Sabino Mullane <[email protected]>
Tue, 12 Jul 2011 02:23:53 +0000 (22:23 -0400)
committerGreg Sabino Mullane <[email protected]>
Tue, 12 Jul 2011 02:23:53 +0000 (22:23 -0400)
check_postgres.pl

index 41e0aec3e18b2b4dc755456ce8fceb5add9804a5..074761c1bcf37f1309532831dbc43eddc52d2d63 100755 (executable)
@@ -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)};
         }