Changeset 60
- Timestamp:
- Jul 25, 2009, 1:20:28 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r59 r60 42 42 $SWITCH_DB{$sw->{hostname}} = $sw; 43 43 } 44 @SWITCH = sort { $switch_level{$b->{hostname}} <=> $switch_level{$a->{hostname}} } @{$KLASK_CFG->{switch}};44 @SWITCH = reverse sort { $switch_level{$a->{hostname}} <=> $switch_level{$b->{hostname}} } @{$KLASK_CFG->{switch}}; 45 45 46 46 my %SWITCH_PORT_COUNT = (); … … 111 111 } 112 112 else { 113 print STDERR"klask: command $cmd not found\n\n";113 print {*STDERR} "klask: command $cmd not found\n\n"; 114 114 $CMD_DB{help}->(); 115 115 exit 1; … … 176 176 # my $cmd = "grep -e '".'\b'."$param_ip_or_host".'\b'."' /var/lib/arpwatch/arp.dat | sort +2rn | head -1"; 177 177 # my $cmd = "grep -he '".'\b'."$param_ip_or_host".'\b'."' /var/lib/arpwatch/*.dat | sort +2rn | head -1"; 178 my $cmd = "grep -he '" . '\b' . "$param_ip_or_host" . '\b' . "'/var/lib/arpwatch/$interface.dat | sort -rn -k 3,3 | head -1";178 my $cmd = q{grep -he '\b} . $param_ip_or_host . q{\b' } . "/var/lib/arpwatch/$interface.dat | sort -rn -k 3,3 | head -1"; 179 179 my $cmd_arpwatch = shell_command $cmd; 180 180 my ($arp, $ip, $timestamp, $host) = split m/ \s+ /xms, $cmd_arpwatch; … … 300 300 '0'=>'0', '1'=>'1', '2'=>'2', '3'=>'3', '4'=>'4', 301 301 '5'=>'5', '6'=>'6', '7'=>'7', '8'=>'8', '9'=>'9', 302 'A'=>'10', 'B'=>'11', 'C'=>'12', 'D'=>'13', 'E'=>'14', 'F'=>'15' 302 'A'=>'10', 'B'=>'11', 'C'=>'12', 'D'=>'13', 'E'=>'14', 'F'=>'15', 303 303 ); 304 304 my @chars = split m//xms, $car; … … 1414 1414 1415 1415 my $swname = $sw; 1416 $swname .= '\n-\n'."$db_switch_global{$sw}->{model}" if exists $db_switch_global{$sw} and exists $db_switch_global{$sw}->{model};1416 $swname .= q{\n-\n} . "$db_switch_global{$sw}->{model}" if exists $db_switch_global{$sw} and exists $db_switch_global{$sw}->{model}; 1417 1417 print "\"$sw\" [label = \"$swname\", color = black, fillcolor = palegreen, shape = rect, style = filled];\n"; 1418 1418 print "\"location$b-$l\" -> \"$sw\" [len = 2, color = firebrick, arrowtail = dot]\n";
Note: See TracChangeset
for help on using the changeset viewer.