switches |
Subversion Repositories: |
Rev 16 | Rev 17 | |
---|---|---|
Line 14... | Line 14... | |
my %sw_d = (); |
my %sw_d = (); | |
|
| |
my $portlist = ""; |
my $portlist = ""; | |
my $p = 0; |
my $p = 0; | |
my $d = ""; |
my $d = ""; | |
my ($fnc,$mac,$if,$bin,$geom,$desc); |
my ($fnc,$mac,$if,$ver,$bin,$geom,$desc); | |
|
| |
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"; | |
Line 47... | Line 47... | |
} |
} | |
} |
} | |
close CONF; |
close CONF; | |
|
| |
foreach (@sw) { |
foreach (@sw) { | |
($fnc, $mac, $if, $bin, $geom, $desc) = split /\|/; |
($fnc, $mac, $if, $ver, $bin, $geom, $desc) = split /\|/; | |
SWITCH: { |
SWITCH: { | |
if ($fnc eq "draw_rrcp_switch") { |
if ($fnc eq "draw_rrcp_switch") { | |
draw_rrcp_switch($mac,$if,$bin,$desc,$map{$geom},\%sw_d); |
draw_rrcp_switch($mac,$if,$bin,$desc,$map{$geom},\%sw_d); | |
last SWITCH; |
last SWITCH; | |
} |
} | |
if ($fnc eq "draw_snmp_switch") { |
if ($fnc eq "draw_snmp_switch") { | |
draw_snmp_switch($mac,$if,$bin,$desc,$map{$geom},\%sw_d); |
draw_snmp_switch($mac,$if,$ver,$bin,$desc,$map{$geom},\%sw_d); | |
last SWITCH; |
last SWITCH; | |
} |
} | |
} |
} | |
print "<br>\n"; |
print "<br>\n"; | |
} |
} | |
Line 148... | Line 148... | |
} |
} | |
|
| |
sub draw_snmp_switch { |
sub draw_snmp_switch { | |
my $myip = shift(@_); |
my $myip = shift(@_); | |
my $com = shift(@_); |
my $com = shift(@_); | |
my $ver = shift(@_); | ||
my $dhcp = shift(@_); |
my $dhcp = shift(@_); | |
my $desc = shift(@_); |
my $desc = shift(@_); | |
my @map = @{shift(@_)}; |
my @map = @{shift(@_)}; | |
my $sw_d = shift(@_); |
my $sw_d = shift(@_); | |
|
| |
Line 185... | Line 186... | |
my $hip = ""; |
my $hip = ""; | |
my @row = (); |
my @row = (); | |
|
| |
print "<b>$desc</b> <a href=http:\/\/$myip>$myip</a>"; |
print "<b>$desc</b> <a href=http:\/\/$myip>$myip</a>"; | |
|
| |
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 $ver $myip .1.3.6.1.2.1.2.2.1.5`; | |
my $adminstatusall = `$snmpwalk -Os -c $com -v 2c $myip .1.3.6.1.2.1.2.2.1.7`; |
my $adminstatusall = `$snmpwalk -Os -c $com -v $ver $myip .1.3.6.1.2.1.2.2.1.7`; | |
my $operstatusall = `$snmpwalk -Os -c $com -v 2c $myip .1.3.6.1.2.1.2.2.1.8`; |
my $operstatusall = `$snmpwalk -Os -c $com -v $ver $myip .1.3.6.1.2.1.2.2.1.8`; | |
my $mactable = `$snmpwalk -Os -c $com -v 2c $myip atPhysAddress`; |
my $mactable = `$snmpwalk -Os -c $com -v $ver $myip atPhysAddress`; | |
my $mactableport = `$snmpwalk -Os -c $com -v 2c $myip ipNetToMediaIfIndex`; |
my $mactableport = `$snmpwalk -Os -c $com -v $ver $myip ipNetToMediaIfIndex`; | |
my $dhcpdconf = `wget -t 1 -T 1 http://$dhcp/cgi-bin/dhcp.cgi -q -O -`; |
my $dhcpdconf = `wget -t 1 -T 1 http://$dhcp/cgi-bin/dhcp.cgi -q -O -`; | |
# $arpn = `wget -t 1 -T 1 http://$dhcp/cgi-bin/arpn.cgi -q -O -`; |
# $arpn = `wget -t 1 -T 1 http://$dhcp/cgi-bin/arpn.cgi -q -O -`; | |
|
| |
foreach (split("\n",$operstatusall)) { |
foreach (split("\n",$operstatusall)) { | |
s/^ifOperStatus\.([0-9]+) = INTEGER: (.*)$/$1 $2/; |
s/^ifOperStatus\.([0-9]+) = INTEGER: (.*)$/$1 $2/; |