Changeset 78 for trunk/klask


Ignore:
Timestamp:
Mar 24, 2011, 6:33:19 PM (13 years ago)
Author:
g7moreau
Message:
  • Last change. Limit arpwatch cache two 1.1 hour
  • Some format thing
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r77 r78  
    8484   J9449A => { model => 'HP1810-8G',  match => 'HP ProCurve 1810G - 8 GE'        },
    8585   J4093A => { model => 'HP2424M',    match => 'HP J4093A ProCurve Switch 2424M' },
     86   J9279A => { model => 'HP2510G-24', match => 'ProCurve J9279A Switch 2510G-24' },
    8687   J9280A => { model => 'HP2510G-48', match => 'ProCurve J9280A Switch 2510G-48' },
    8788   J4813A => { model => 'HP2524',     match => 'HP J4813A ProCurve Switch 2524'  },
     
    216217   my $nowtimestamp = time;
    217218
    218    if ( $type eq 'fast' and ( not defined $timestamp or $timestamp < ( $nowtimestamp - 3 * 3600 ) ) ) {
     219   if ( $type eq 'fast' and ( not defined $timestamp or $timestamp < ( $nowtimestamp - 1.1 * 3600 ) ) ) {
    219220      $ret{mac_address} = 'unknow';
    220221      return %ret;
     
    956957   my $computerdb = YAML::Syck::LoadFile("$KLASK_DB_FILE");
    957958
    958    printf "%-25s %-4s            %-40s %-15s %-18s %-16s %s\n", qw(Switch Port Hostname-FQ IPv4-Address MAC-Address Date VLAN);
    959    print "-------------------------------------------------------------------------------------------------------------------------------------------\n";
     959   printf "%-26s %-4s            %-40s %-15s %-18s %-16s %s\n", qw(Switch Port Hostname-FQ IPv4-Address MAC-Address Date VLAN);
     960   print "--------------------------------------------------------------------------------------------------------------------------------------------\n";
    960961
    961962   LOOP_ON_IP_ADDRESS:
     
    975976      my $date = sprintf '%04i-%02i-%02i %02i:%02i', $year, $mon, $mday, $hour, $min;
    976977
    977       printf "%-26s  %2s  <-------  %-40s %-15s %-18s %-16s %s\n",
     978      printf "%-27s  %2s  <-------  %-40s %-15s %-18s %-16s %s\n",
    978979         $computerdb->{$ip}{switch_hostname} || $computerdb->{$ip}{switch_description},
    979980         $computerdb->{$ip}{switch_port},
     
    15691570   for my $sw (sort keys %db_switch_output_port) {
    15701571      if (exists $db_switch_parent{$sw}) {
    1571          printf "%-25s  %2s  +-->  %2s  %-25s\n", $sw, $db_switch_output_port{$sw}, $db_switch_parent{$sw}->{port}, $db_switch_parent{$sw}->{switch};
     1572         printf "%-27s  %2s  +-->  %2s  %-25s\n", $sw, $db_switch_output_port{$sw}, $db_switch_parent{$sw}->{port}, $db_switch_parent{$sw}->{switch};
    15721573         }
    15731574      else {
    1574          printf "%-25s  %2s  +-->  router\n", $sw, $db_switch_output_port{$sw};
     1575         printf "%-27s  %2s  +-->  router\n", $sw, $db_switch_output_port{$sw};
    15751576         }
    15761577      }
     
    15831584      for my $sw (keys %{$db_switch_connected_on_port{$swport}}) {
    15841585         if (exists $db_switch_output_port{$sw}) {
    1585             printf "%-25s  %2s  <--+  %2s  %-25s\n", $sw_connect, $port_connect, $db_switch_output_port{$sw}, $sw;
     1586            printf "%-27s  %2s  <--+  %2s  %-25s\n", $sw_connect, $port_connect, $db_switch_output_port{$sw}, $sw;
    15861587            }
    15871588         else {
    1588             printf "%-25s  %2s  <--+      %-25s\n", $sw_connect, $port_connect, $sw;
     1589            printf "%-27s  %2s  <--+      %-25s\n", $sw_connect, $port_connect, $sw;
    15891590            }
    15901591         }
     
    16371638   for my $sw (sort keys %db_switch_output_port) {
    16381639      if (exists $db_switch_parent{$sw}) {
    1639          printf "%-25s  %2s  +-->  %2s  %-25s\n", $sw, $db_switch_output_port{$sw}, $db_switch_parent{$sw}->{port}, $db_switch_parent{$sw}->{switch};
     1640         printf "%-27s  %2s  +-->  %2s  %-25s\n", $sw, $db_switch_output_port{$sw}, $db_switch_parent{$sw}->{port}, $db_switch_parent{$sw}->{switch};
    16401641         }
    16411642      else {
    1642          printf "%-25s  %2s  +-->  router\n", $sw, $db_switch_output_port{$sw};
     1643         printf "%-27s  %2s  +-->  router\n", $sw, $db_switch_output_port{$sw};
    16431644         }
    16441645      }
     
    16511652      for my $sw (keys %{$db_switch_connected_on_port{$swport}}) {
    16521653         if (exists $db_switch_output_port{$sw}) {
    1653             printf "%-25s  %2s  <--+  %2s  %-25s\n", $sw_connect, $port_connect, $db_switch_output_port{$sw}, $sw;
     1654            printf "%-27s  %2s  <--+  %2s  %-25s\n", $sw_connect, $port_connect, $db_switch_output_port{$sw}, $sw;
    16541655            }
    16551656         else {
    1656             printf "%-25s  %2s  <--+      %-25s\n", $sw_connect, $port_connect, $sw;
     1657            printf "%-27s  %2s  <--+      %-25s\n", $sw_connect, $port_connect, $sw;
    16571658            }
    16581659         }
Note: See TracChangeset for help on using the changeset viewer.