Changeset 62
- Timestamp:
- Sep 4, 2009, 4:40:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r61 r62 39 39 $SWITCH_DB{$sw->{hostname}} = $sw; 40 40 } 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}}; 42 42 43 43 my %SWITCH_PORT_COUNT = (); … … 154 154 # my $cmd = "grep -e '".'\b'."$param_ip_or_host".'\b'."' /var/lib/arpwatch/arp.dat | sort +2rn | head -1"; 155 155 # 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; 160 159 161 160 #print "OOO $cmd\n"; … … 287 286 return '00' if $car eq '00UNKNOW'; 288 287 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' 291 291 ); 292 292 my @chars = split(//, $car);
Note: See TracChangeset
for help on using the changeset viewer.