Changeset 82


Ignore:
Timestamp:
Mar 30, 2011, 9:15:33 AM (13 years ago)
Author:
g7moreau
Message:
  • Some litle change in format
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r81 r82  
    280280   my $verbose = shift;
    281281
    282    printf "%-25s                %-25s %s\n",'Switch','Description','Type';
    283    print "-------------------------------------------------------------------------\n" if $verbose;
     282   printf "%-26s                %-25s %s\n",'Switch','Description','Type';
     283   print "------------------------------------------------------------------------------\n" if $verbose;
    284284
    285285   INIT_EACH_SWITCH:
     
    316316      # Ligne à virer car on récupère maintenant le modèle du switch
    317317      my ($desc, $type) = split m/ : /xms, $sw->{description}, 2;
    318       printf "%-25s 0--------->>>> %-25s %s\n", $sw->{hostname}, $desc, $sw->{model} if $verbose;
     318      printf "%-26s 0--------->>>> %-25s %s\n", $sw->{hostname}, $desc, $sw->{model} if $verbose;
    319319      }
    320320
     
    957957   my $computerdb = YAML::Syck::LoadFile("$KLASK_DB_FILE");
    958958
    959    printf "%-26s %-4s            %-40s %-15s %-18s %-16s %s\n", qw(Switch Port Hostname-FQ IPv4-Address MAC-Address Date VLAN);
     959   printf "%-27s %-4s            %-40s %-15s %-18s %-16s %s\n", qw(Switch Port Hostname-FQ IPv4-Address MAC-Address Date VLAN);
    960960   print "--------------------------------------------------------------------------------------------------------------------------------------------\n";
    961961
     
    976976      my $date = sprintf '%04i-%02i-%02i %02i:%02i', $year, $mon, $mday, $hour, $min;
    977977
    978       printf "%-27s  %2s  <-------  %-40s %-15s %-18s %-16s %s\n",
     978      printf "%-28s  %2s  <-------  %-40s %-15s %-18s %-16s %s\n",
    979979         $computerdb->{$ip}{switch_hostname} || $computerdb->{$ip}{switch_description},
    980980         $computerdb->{$ip}{switch_port},
     
    14761476      next ALL_SWITCH if $resol_arp{mac_address} eq 'unknow';
    14771477
    1478       push @list_switch_ipv4,$resol_arp{ipv4_address};
     1478      push @list_switch_ipv4, $resol_arp{ipv4_address};
    14791479
    14801480      $where{$resol_arp{ipv4_address}} = find_all_switch_port($resol_arp{mac_address}); # find port on all switch
    14811481
    14821482      if ($verbose) {
    1483          my @l = ();
    1484          for my $c  ( keys %{$where{$resol_arp{ipv4_address}}} ) {
    1485             push @l, "$c -+ "; #$where{$resol_arp{ipv4_address}}->{$c}{hostname};
    1486             }
    1487          print "VERBOSE_3 $one_computer $resol_arp{ipv4_address} $resol_arp{mac_address} --- @l\n";
     1483#         my @l = ();
     1484#         for my $c  ( keys %{$where{$resol_arp{ipv4_address}}} ) {
     1485#            push @l, "$c -+ "; #$where{$resol_arp{ipv4_address}}->{$c}{hostname};
     1486#            }
     1487         print "VERBOSE_3 $one_computer $resol_arp{ipv4_address} $resol_arp{mac_address}\n";
     1488         print "VERBOSE_3 $one_computer --- ",
     1489            join(' + ', keys %{$where{$resol_arp{ipv4_address}}}),
     1490            "\n";
    14881491         }
    14891492
     
    15821585   for my $sw (sort keys %db_switch_output_port) {
    15831586      if (exists $db_switch_parent{$sw}) {
    1584          printf "%-27s  %2s  +-->  %2s  %-25s\n", $sw, $db_switch_output_port{$sw}, $db_switch_parent{$sw}->{port}, $db_switch_parent{$sw}->{switch};
     1587         printf "%-28s  %2s  +-->  %2s  %-25s\n", $sw, $db_switch_output_port{$sw}, $db_switch_parent{$sw}->{port}, $db_switch_parent{$sw}->{switch};
    15851588         }
    15861589      else {
    1587          printf "%-27s  %2s  +-->  router\n", $sw, $db_switch_output_port{$sw};
     1590         printf "%-28s  %2s  +-->  router\n", $sw, $db_switch_output_port{$sw};
    15881591         }
    15891592      }
     
    15961599      for my $sw (keys %{$db_switch_connected_on_port{$swport}}) {
    15971600         if (exists $db_switch_output_port{$sw}) {
    1598             printf "%-27s  %2s  <--+  %2s  %-25s\n", $sw_connect, $port_connect, $db_switch_output_port{$sw}, $sw;
     1601            printf "%-28s  %2s  <--+  %2s  %-25s\n", $sw_connect, $port_connect, $db_switch_output_port{$sw}, $sw;
    15991602            }
    16001603         else {
    1601             printf "%-27s  %2s  <--+      %-25s\n", $sw_connect, $port_connect, $sw;
     1604            printf "%-28s  %2s  <--+      %-25s\n", $sw_connect, $port_connect, $sw;
    16021605            }
    16031606         }
     
    16501653   for my $sw (sort keys %db_switch_output_port) {
    16511654      if (exists $db_switch_parent{$sw}) {
    1652          printf "%-27s  %2s  +-->  %2s  %-25s\n", $sw, $db_switch_output_port{$sw}, $db_switch_parent{$sw}->{port}, $db_switch_parent{$sw}->{switch};
     1655         printf "%-28s  %2s  +-->  %2s  %-25s\n", $sw, $db_switch_output_port{$sw}, $db_switch_parent{$sw}->{port}, $db_switch_parent{$sw}->{switch};
    16531656         }
    16541657      else {
    1655          printf "%-27s  %2s  +-->  router\n", $sw, $db_switch_output_port{$sw};
     1658         printf "%-28s  %2s  +-->  router\n", $sw, $db_switch_output_port{$sw};
    16561659         }
    16571660      }
     
    16641667      for my $sw (keys %{$db_switch_connected_on_port{$swport}}) {
    16651668         if (exists $db_switch_output_port{$sw}) {
    1666             printf "%-27s  %2s  <--+  %2s  %-25s\n", $sw_connect, $port_connect, $db_switch_output_port{$sw}, $sw;
     1669            printf "%-28s  %2s  <--+  %2s  %-25s\n", $sw_connect, $port_connect, $db_switch_output_port{$sw}, $sw;
    16671670            }
    16681671         else {
    1669             printf "%-27s  %2s  <--+      %-25s\n", $sw_connect, $port_connect, $sw;
     1672            printf "%-28s  %2s  <--+      %-25s\n", $sw_connect, $port_connect, $sw;
    16701673            }
    16711674         }
Note: See TracChangeset for help on using the changeset viewer.