Changeset 62 for trunk


Ignore:
Timestamp:
Sep 4, 2009, 4:40:13 PM (15 years ago)
Author:
g7moreau
Message:
  • Cancel last commit
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r61 r62  
    3939   $SWITCH_DB{$sw->{hostname}} = $sw;
    4040   }
    41 @SWITCH = sort { $switch_level{$b->{hostname}} <=> $switch_level{$a->{hostname}} } @{$KLASK_CFG->{switch}}; 
     41@SWITCH = sort { $switch_level{$b->{hostname}} <=> $switch_level{$a->{hostname}} } @{$KLASK_CFG->{switch}};
    4242
    4343my %SWITCH_PORT_COUNT = ();
     
    154154   # my $cmd = "grep  -e '".'\b'."$param_ip_or_host".'\b'."' /var/lib/arpwatch/arp.dat | sort +2rn | head -1";
    155155   # my $cmd = "grep  -he '".'\b'."$param_ip_or_host".'\b'."' /var/lib/arpwatch/*.dat | sort +2rn | head -1";
    156    my $cmd = "grep  -he '".'\b'."$param_ip_or_host".'\b'."' /var/lib/arpwatch/$interface.dat | sort -rn -k 3,3 | head -1";
    157    my $cmd_arpwatch = `$cmd`;
    158    chomp $cmd_arpwatch;
    159    my ($arp, $ip, $timestamp, $host) = split /\s+/, $cmd_arpwatch;
     156   my $cmd = "grep  -he '" . '\b' . "$param_ip_or_host" . '\b' . "' /var/lib/arpwatch/$interface.dat | sort -rn -k 3,3 | head -1";
     157   my $cmd_arpwatch = shell_command $cmd;
     158   my ($arp, $ip, $timestamp, $host) = split m/ \s+ /xms, $cmd_arpwatch;
    160159
    161160#print "OOO $cmd\n";
     
    287286   return '00' if $car eq '00UNKNOW';
    288287   my %table = (
    289       "0"=>"0",  "1"=>"1",  "2"=>"2",  "3"=>"3",  "4"=>"4",  "5"=>"5", "6"=>"6", "7"=>"7", "8"=>"8", "9"=>"9",
    290       "A"=>"10", "B"=>"11", "C"=>"12", "D"=>"13", "E"=>"14", "F"=>"15"
     288      '0'=>'0',  '1'=>'1',  '2'=>'2',  '3'=>'3',  '4'=>'4',
     289      '5'=>'5',  '6'=>'6',  '7'=>'7',  '8'=>'8',  '9'=>'9',
     290      'A'=>'10', 'B'=>'11', 'C'=>'12', 'D'=>'13', 'E'=>'14', 'F'=>'15'
    291291      );
    292292   my @chars = split(//, $car);
Note: See TracChangeset for help on using the changeset viewer.