switches |
Subversion Repositories: |
Rev 15 | Rev 16 | |
---|---|---|
Line 124... | Line 124... | |
$bg = "\"#FFFFFF\""; |
$bg = "\"#FFFFFF\""; | |
print " <td valign=top width=\"$sirka\" "; |
print " <td valign=top width=\"$sirka\" "; | |
if ($port = $map[$y][$x]) { |
if ($port = $map[$y][$x]) { | |
($enab,$mod,$stat,$link,$flow) = @{$pole[$port]}[0..4]; |
($enab,$mod,$stat,$link,$flow) = @{$pole[$port]}[0..4]; | |
if ($link eq "LINK") { $bg = "\"#00FF00\""; } |
if ($link eq "LINK") { $bg = "\"#00FF00\""; } | |
if ($mod eq "1000M") { $bg = "\"#FFFF00\""; } | ||
} |
} | |
print "bgcolor=$bg>"; |
print "bgcolor=$bg>"; | |
if ($port) { |
if ($port) { | |
$e = substr($enab,0,1); |
$e = substr($enab,0,1); | |
if (defined($sw_d->{$mac}[$port])) {$label = $sw_d->{$mac}[$port];} |
if (defined($sw_d->{$mac}[$port])) {$label = $sw_d->{$mac}[$port];} | |
else { $label = ""; } |
else { $label = ""; } | |
if ($flow eq "flowctl") { $f = "Y"; } else { $f = "N"; } |
if ($flow eq "flowctl") { $f = "Y"; } else { $f = "N"; } | |
$hmac = $mac; |
$hmac = $mac; | |
$hmac =~ s/:/_/g; |
$hmac =~ s/:/_/g; | |
print_port_graph("10.33.0.74","${hmac}_${port}.html","${hmac}_${port}-day.png","$mac port $port $label","$port $label"); |
print_port_graph("10.33.0.2","${hmac}_${port}.html","${hmac}_${port}-day.png","$mac port $port $label","$port $label"); | |
print "<br />$e $mod $stat $f</td>\n"; |
print "<br />$e $mod $stat $f</td>\n"; | |
} else { |
} else { | |
print " </td>\n"; |
print " </td>\n"; | |
} |
} | |
} |
} | |
Line 205... | Line 206... | |
$pole_adminstatus[$row[0]] = $row[1]; |
$pole_adminstatus[$row[0]] = $row[1]; | |
} |
} | |
foreach (split("\n",$speedall)) { |
foreach (split("\n",$speedall)) { | |
s/^ifSpeed\.([0-9]+) = Gauge32: (.*)$/$1 $2/; |
s/^ifSpeed\.([0-9]+) = Gauge32: (.*)$/$1 $2/; | |
@row = split ; |
@row = split ; | |
$row[1] =~ s/000000$/M/; |
$row[1] =~ s/10000000$/10M/; | |
$row[1] =~ s/100000000$/100M/; | ||
$row[1] =~ s/1000000000$/1G/; | ||
$row[1] =~ s/4294967295$/10G/; | ||
$pole_speed[$row[0]] = $row[1]; |
$pole_speed[$row[0]] = $row[1]; | |
} |
} | |
foreach (split("\n",$mactable)) { |
foreach (split("\n",$mactable)) { | |
s/ = Hex-STRING://; |
s/ = Hex-STRING://; | |
($macind, my $tmpmac) = split(" ", $_, 2); |
($macind, my $tmpmac) = split(" ", $_, 2); | |
Line 259... | Line 263... | |
if (defined($pole_speed[$port])) { $stat = $pole_speed[$port]; } else { $stat = ""; } |
if (defined($pole_speed[$port])) { $stat = $pole_speed[$port]; } else { $stat = ""; } | |
if (defined($pole_operstatus[$port])) { $link = $pole_operstatus[$port]; } else { $link = ""; } |
if (defined($pole_operstatus[$port])) { $link = $pole_operstatus[$port]; } else { $link = ""; } | |
$flow = ""; |
$flow = ""; | |
if ($enab eq "up(1)") { $bg = "\"#FFFFFF\""; } else { $bg = "\"#FF0000\""; } |
if ($enab eq "up(1)") { $bg = "\"#FFFFFF\""; } else { $bg = "\"#FF0000\""; } | |
if ($link eq "up(1)") { |
if ($link eq "up(1)") { | |
if ($stat eq "1000M") { $bg = "\"#00FF00\""; } else { $bg = "\"#FFFF00\""; } |
if ($stat eq "1G" || $stat eq "10G") { $bg = "\"#00FF00\""; } else { $bg = "\"#FFFF00\""; } | |
} |
} | |
} |
} | |
print "bgcolor=$bg>"; |
print "bgcolor=$bg>"; | |
if ($port) { |
if ($port) { | |
if ($enab =~ /^up/) {$e = "E";} else {$e = "D";} |
if ($enab =~ /^up/) {$e = "E";} else {$e = "D";} | |
Line 271... | Line 275... | |
else { $label = ""; } |
else { $label = ""; } | |
$hip = $myip; |
$hip = $myip; | |
$hip =~ s/\./_/g; |
$hip =~ s/\./_/g; | |
print_port_graph("$dhcp","${hip}_port${port}.html","${hip}_port${port}-day.png","$myip port $port $label","$port $label"); |
print_port_graph("$dhcp","${hip}_port${port}.html","${hip}_port${port}-day.png","$myip port $port $label","$port $label"); | |
print "<br />$e $stat<br />\n"; |
print "<br />$e $stat<br />\n"; | |
print "<pre>"; |
||
foreach $mac (@{ $mactab{$port} }) { |
foreach $mac (@{ $mactab{$port} }) { | |
if (exists $pole_dhcpdhosts{$mac}) { |
if (exists $pole_dhcpdhosts{$mac}) { | |
$barva = "black"; |
$barva = "black"; | |
$title = "$mac " . $pole_dhcpdhosts{$mac}; |
$title = "$mac " . $pole_dhcpdhosts{$mac}; | |
$popis = $pole_dhcpdhosts{$mac}; |
$popis = $pole_dhcpdhosts{$mac}; | |
Line 286... | Line 289... | |
if ($macinfo) { ($macip) = split(" ", $macinfo, 1) } else { $macip = "none" }; |
if ($macinfo) { ($macip) = split(" ", $macinfo, 1) } else { $macip = "none" }; | |
$title = "$mac je neznama MAC adresa! Nalezena IP : $macip"; |
$title = "$mac je neznama MAC adresa! Nalezena IP : $macip"; | |
} |
} | |
print "<font color=$barva title=\"$title\">$popis</font><br>" |
print "<font color=$barva title=\"$title\">$popis</font><br>" | |
}; |
}; | |
print "</pre></td>"; |
print "</td>"; | |
} else { |
} else { | |
print " </td>\n"; |
print " </td>\n"; | |
} |
} | |
} |
} | |
print "</tr>\n"; |
print "</tr>\n"; |