switches |
Subversion Repositories: |
Rev 9 | Rev 10 | |
---|---|---|
Line 20... | Line 20... | |
|
| |
print "Content-type: text/html\n\n"; |
print "Content-type: text/html\n\n"; | |
|
| |
print "<HTML><HEAD>\n<META HTTP-EQUIV=Pragma CONTENT=no-cache>\n<style type=\"text/css\" media=\"screen\"> \@import \"../style.css\" ;</style>\n"; |
print "<HTML><HEAD>\n<META HTTP-EQUIV=Pragma CONTENT=no-cache>\n<style type=\"text/css\" media=\"screen\"> \@import \"../style.css\" ;</style>\n"; | |
print "<META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-2\">\n"; |
print "<META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-2\">\n"; | |
#print "<script type=\"text/javascript\" src=\"overlib.js\"><!-- overLIB (c) Erik Bosrup --></script>\n"; |
print "<script type=\"text/javascript\" src=\"../overlib.js\"><!-- overLIB (c) Erik Bosrup --></script>\n"; | |
print "</HEAD><BODY>\n"; |
print "</HEAD><BODY>\n"; | |
#nocache! |
#nocache! | |
|
| |
print "<div id=\"overDiv\" style=\"position:absolute; visibility:hidden; z-index:1000;\"></div>"; |
print "<div id=\"overDiv\" style=\"position:absolute; visibility:hidden; z-index:1000;\"></div>"; | |
|
| |
Line 67... | Line 67... | |
print "<BR>$date\n<BR>"; |
print "<BR>$date\n<BR>"; | |
|
| |
print "</center></BODY></HTML>"; |
print "</center></BODY></HTML>"; | |
|
| |
################################################################################ |
################################################################################ | |
| ||
sub print_port_graph { | ||
my $ip = shift(@_); | ||
my $page = shift(@_); | ||
my $graph = shift(@_); | ||
my $caption = shift(@_); | ||
my $text = shift(@_); | ||
| ||
print "<a href=\"http://${ip}/hotsanic/traffic/${page}\" onmouseover=\"return overlib('<img src=http://${ip}/hotsanic/traffic/${graph}>',DELAY,250,HAUTO,VAUTO,CAPTION,'${caption}');\" onmouseout=\"return nd();\" shape=\"rect\">$text</a>"; | ||
| ||
} # end print_port_graph | ||
|
| |
sub draw_rrcp_switch { |
sub draw_rrcp_switch { | |
my $mac = shift(@_); |
my $mac = shift(@_); | |
my $if = shift(@_); |
my $if = shift(@_); | |
my $bin = shift(@_); |
my $bin = shift(@_); | |
Line 78... | Line 89... | |
my @map = @{shift(@_)}; |
my @map = @{shift(@_)}; | |
my $sw_d = shift(@_); |
my $sw_d = shift(@_); | |
|
| |
my $w = scalar( @{$map[0]} ); |
my $w = scalar( @{$map[0]} ); | |
my $h = scalar @map; |
my $h = scalar @map; | |
my $hmac = ""; | ||
my $x = 0; |
my $x = 0; | |
my $y = 0; |
my $y = 0; | |
my $e = ""; |
my $e = ""; | |
my $f = ""; |
my $f = ""; | |
my $sirka = 70; |
my $sirka = 70; | |
Line 119... | Line 131... | |
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"; } | |
print "$port $label<br />$e $mod $stat $f</td>\n"; |
$hmac = $mac; | |
$hmac =~ s/:/_/g; | ||
print_port_graph("10.33.0.74","${hmac}_${port}.html","${hmac}_${port}-day.png","$mac port $port $label","$port $label"); | ||
print "<br />$e $mod $stat $f</td>\n"; | ||
} else { |
} else { | |
print " </td>\n"; |
print " </td>\n"; | |
} |
} | |
} |
} | |
print "</tr>\n"; |
print "</tr>\n"; | |
Line 164... | Line 179... | |
my $barva = ""; |
my $barva = ""; | |
my $title = ""; |
my $title = ""; | |
my $popis = ""; |
my $popis = ""; | |
my $macinfo = ""; |
my $macinfo = ""; | |
my $macip = ""; |
my $macip = ""; | |
my $hip = ""; | ||
my @row = (); |
my @row = (); | |
|
| |
print "<b>$desc</b> $myip"; |
print "<b>$desc</b> $myip"; | |
|
| |
my $speedall = `$snmpwalk -Os -c $com -v 2c $myip .1.3.6.1.2.1.2.2.1.5`; |
my $speedall = `$snmpwalk -Os -c $com -v 2c $myip .1.3.6.1.2.1.2.2.1.5`; | |
Line 248... | Line 264... | |
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";} | |
if (defined($sw_d->{$myip}[$port])) {$label = $sw_d->{$myip}[$port];} |
if (defined($sw_d->{$myip}[$port])) {$label = $sw_d->{$myip}[$port];} | |
else { $label = ""; } |
else { $label = ""; } | |
print "$port $label<br />$e $stat<br />\n"; |
$hip = $myip; | |
$hip =~ s/\./_/g; | ||
print_port_graph("10.33.0.74","${hip}_port${port}.html","${hip}_port${port}-day.png","$myip port $port $label","$port $label"); | ||
print "<br />$e $stat<br />\n"; | ||
print "<pre>"; |
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}; |