*** empty log message ***
This commit is contained in:
@@ -15,14 +15,12 @@ device-vendor: Asante
|
|||||||
device-family: Hubs
|
device-family: Hubs
|
||||||
|
|
||||||
device: 1012
|
device: 1012
|
||||||
vendor: asante
|
|
||||||
macsuck: no
|
macsuck: no
|
||||||
|
|
||||||
# Bay
|
# Bay
|
||||||
device-vendor: Bay Networks
|
device-vendor: Bay Networks
|
||||||
|
|
||||||
device-family: BayStack
|
device-family: BayStack
|
||||||
vendor: bay
|
|
||||||
macsuck: yes
|
macsuck: yes
|
||||||
cdp: proprietary
|
cdp: proprietary
|
||||||
note: SNMP interface does not respond after 2+ months of uptime. Reboot to fix.
|
note: SNMP interface does not respond after 2+ months of uptime. Reboot to fix.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
$DevMatrix = '../DeviceMatrix.txt';
|
$DevMatrix = '../DeviceMatrix.txt';
|
||||||
$DevHTML = 'DeviceMatrix.html';
|
$DevHTML = 'DeviceMatrix.html';
|
||||||
$DevPNG = 'DeviceMatrix.png';
|
$DevPNG = 'DeviceMatrix.png';
|
||||||
$Tab = 2;
|
$Attributes= {};
|
||||||
|
|
||||||
# Parse Data File
|
# Parse Data File
|
||||||
$matrix = parse_data($DevMatrix);
|
$matrix = parse_data($DevMatrix);
|
||||||
@@ -20,29 +20,61 @@ if ($@ or 1) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
open (HTML, "> $DevHTML") or die "Can't open $DevHTML. $!\n";
|
open (HTML, "> $DevHTML") or die "Can't open $DevHTML. $!\n";
|
||||||
|
$old_fh = select(HTML);
|
||||||
|
&html_head;
|
||||||
|
print_vendors($matrix);
|
||||||
foreach my $vendor (sort sort_nocase keys %$matrix){
|
foreach my $vendor (sort sort_nocase keys %$matrix){
|
||||||
print "$vendor\n";
|
print "<A NAME=\"$vendor\"><SPAN CLASS=\"vendor\"><B>$vendor</B></SPAN></A>\n";
|
||||||
|
print "<DL>\n";
|
||||||
|
|
||||||
my $defaults = $matrix->{$vendor}->{defaults};
|
my $vendor_defaults = $matrix->{$vendor}->{defaults};
|
||||||
print_defaults($defaults,1);
|
print_notes($vendor_defaults,1);
|
||||||
|
|
||||||
my $families = $matrix->{$vendor}->{families};
|
my $families = $matrix->{$vendor}->{families};
|
||||||
foreach my $family (sort sort_nocase keys %$families ) {
|
foreach my $family (sort sort_nocase keys %$families ) {
|
||||||
print " $family\n";
|
print "<DT>$family Family\n";
|
||||||
|
|
||||||
my $defaults = $families->{$family}->{defaults};
|
my $family_defaults = $families->{$family}->{defaults};
|
||||||
print_defaults($defaults,2);
|
print_notes($family_defaults,2);
|
||||||
|
|
||||||
my $models = $families->{$family}->{models};
|
my $models = $families->{$family}->{models};
|
||||||
foreach my $model (sort sort_nocase keys %$models ){
|
foreach my $model (sort sort_nocase keys %$models ){
|
||||||
print " $model\n";
|
my $model_defaults = $models->{$model}->{defaults};
|
||||||
my $defaults = $models->{$model}->{defaults};
|
print "<DD>$model\n";
|
||||||
print_defaults($defaults,3);
|
print "<DL>\n";
|
||||||
|
print_notes($model_defaults,3);
|
||||||
|
|
||||||
|
print "<DT><DD><TABLE BORDER=1>\n";
|
||||||
|
print_headers();
|
||||||
|
print "<TR>\n";
|
||||||
|
foreach my $a (sort sort_nocase keys %$Attributes) {
|
||||||
|
my $val;
|
||||||
|
next if $a eq 'note';
|
||||||
|
$val = ['-'];
|
||||||
|
$class = 'none';
|
||||||
|
if (defined $model_defaults->{$a}) {
|
||||||
|
$val = $model_defaults->{$a};
|
||||||
|
$class = 'model';
|
||||||
|
} elsif (defined $family_defaults->{$a}){
|
||||||
|
$val = $family_defaults->{$a};
|
||||||
|
$class = 'family';
|
||||||
|
} elsif (defined $vendor_defaults->{$a}){
|
||||||
|
$val = $vendor_defaults->{$a};
|
||||||
|
$class = 'vendor';
|
||||||
|
}
|
||||||
|
print " <TD CLASS='$class'>",join("<BR>\n",@$val),"</TD>\n";
|
||||||
|
}
|
||||||
|
print "</TR></TABLE>\n";
|
||||||
|
print "</DL>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
print "</DL>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
&html_tail;
|
||||||
|
|
||||||
|
select ($old_fh);
|
||||||
close (HTML) or die "Can't write $DevHTML. $!\n";
|
close (HTML) or die "Can't write $DevHTML. $!\n";
|
||||||
|
|
||||||
# Data Structures
|
# Data Structures
|
||||||
@@ -98,6 +130,7 @@ sub parse_data {
|
|||||||
$family = $model = undef;
|
$family = $model = undef;
|
||||||
$Matrix->{$vendor} = {} unless defined $Matrix->{$vendor};
|
$Matrix->{$vendor} = {} unless defined $Matrix->{$vendor};
|
||||||
$class = $Matrix->{$vendor};
|
$class = $Matrix->{$vendor};
|
||||||
|
$class->{defaults}->{type}='vendor';
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,6 +141,7 @@ sub parse_data {
|
|||||||
$Matrix->{$vendor}->{families}->{$family} = {}
|
$Matrix->{$vendor}->{families}->{$family} = {}
|
||||||
unless defined $Matrix->{$vendor}->{families}->{$family};
|
unless defined $Matrix->{$vendor}->{families}->{$family};
|
||||||
$class = $Matrix->{$vendor}->{families}->{$family};
|
$class = $Matrix->{$vendor}->{families}->{$family};
|
||||||
|
$class->{defaults}->{type}='family';
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,11 +152,13 @@ sub parse_data {
|
|||||||
$Matrix->{$vendor}->{families}->{$family}->{models}->{$model} = {}
|
$Matrix->{$vendor}->{families}->{$family}->{models}->{$model} = {}
|
||||||
unless defined $Matrix->{$vendor}->{families}->{$family}->{models}->{$model};
|
unless defined $Matrix->{$vendor}->{families}->{$family}->{models}->{$model};
|
||||||
$class = $Matrix->{$vendor}->{families}->{$family}->{models}->{$model};
|
$class = $Matrix->{$vendor}->{families}->{$family}->{models}->{$model};
|
||||||
|
$class->{defaults}->{type}='device';
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Store attribute
|
# Store attribute
|
||||||
push (@{$class->{defaults}->{$cmd}} , $value);
|
push (@{$class->{defaults}->{$cmd}} , $value);
|
||||||
|
$Attributes->{$cmd}++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $Matrix;
|
return $Matrix;
|
||||||
@@ -132,13 +168,116 @@ sub sort_nocase {
|
|||||||
return lc($a) cmp lc($b);
|
return lc($a) cmp lc($b);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub print_defaults {
|
sub print_notes {
|
||||||
my $defaults = shift;
|
my $defaults = shift;
|
||||||
my $level = shift;
|
my $level = shift;
|
||||||
foreach my $d (sort sort_nocase keys %$defaults) {
|
my $notes = $defaults->{note} || [];
|
||||||
foreach my $val (sort sort_nocase @{$defaults->{$d}}) {
|
foreach my $note (@$notes){
|
||||||
print ' ' x ($Tab*$level);
|
if ($note =~ s/^!//){
|
||||||
print "$d : $val\n";
|
$note = '<SPAN CLASS="note">' . $note . '</SPAN>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (scalar @$notes){
|
||||||
|
print "<DT>\n";
|
||||||
|
my $print_note = join("\n<LI>",@$notes);
|
||||||
|
print "<UL TYPE='square'><LI>$print_note</UL>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub print_vendors {
|
||||||
|
my $matrix=shift;
|
||||||
|
print "<h1>Device Vendors</h1>\n";
|
||||||
|
foreach my $vendor (sort sort_nocase keys %$matrix){
|
||||||
|
print "[<A HREF=\"#$vendor\">$vendor</A>]\n";
|
||||||
|
}
|
||||||
|
print "<HR>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
sub html_head {
|
||||||
|
print <<"end_head";
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<TITLE>SNMP::Info - Device Compatibility Matrix</TITLE>
|
||||||
|
<STYLE TYPE="text/css" MEDIA="screen">
|
||||||
|
<!--
|
||||||
|
BODY { font-family:arial,helvetica,sans-serif; font-size:12pt; }
|
||||||
|
TD { font-family:arial,helvetica,sans-serif; font-size:10pt; }
|
||||||
|
TH { font-family:arial,helvetica,sans-serif; font-size:10pt; background:#F0F0F0; }
|
||||||
|
H1 { font-family:arial,helvetica,sans-serif; font-size:14pt; }
|
||||||
|
.vendor { font-size:12pt; color:#777777; }
|
||||||
|
.family { font-size:12pt; color:blue; }
|
||||||
|
.model { font-size:12pt; color:red; }
|
||||||
|
.note { color:red; }
|
||||||
|
//-->
|
||||||
|
</STYLE>
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<h1>SNMP::Info - Device Compatibility Matrix</h1>
|
||||||
|
<P>
|
||||||
|
end_head
|
||||||
|
}
|
||||||
|
|
||||||
|
sub html_tail {
|
||||||
|
print <<'end_tail';
|
||||||
|
<HR>
|
||||||
|
<h1>Color Key</h1>
|
||||||
|
[<SPAN CLASS="model">Model Attribute</SPAN>]
|
||||||
|
[<SPAN CLASS="family">Family Attribute</SPAN>]
|
||||||
|
[<SPAN CLASS="vendor">Vendor Attribute</SPAN>]
|
||||||
|
<h1>Attribute Key</h1>
|
||||||
|
<TABLE BORDER=1>
|
||||||
|
<TR>
|
||||||
|
<TD>Arpnip</TD>
|
||||||
|
<TD>Ability to collect ARP tables for MAC to IP translation.</TD>
|
||||||
|
</TR>
|
||||||
|
<TR>
|
||||||
|
<TD>CDP</TD>
|
||||||
|
<TD>Cisco Discovery Protocol usable.
|
||||||
|
<UL>
|
||||||
|
<LI><tt>Yes</tt> - Has CDP information through CISCO-CDP-MIB
|
||||||
|
<LI><tt>Proprietary</tt> means the device has its own L2 Discovery Protocol.
|
||||||
|
</UL>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR>
|
||||||
|
<TD>Duplex</TD>
|
||||||
|
<TD>Ability to cull duplex settings from device.<BR>
|
||||||
|
<UL>
|
||||||
|
<LI><tt>no</tt> - Can't recover current or admin setting.
|
||||||
|
<LI><tt>link</tt> - Can get current setting only.
|
||||||
|
<LI><tt>both</tt> - Can get admin and link setting.
|
||||||
|
</UL>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR>
|
||||||
|
<TD>Macsuck</TD>
|
||||||
|
<TD>Ability to get CAM tables for MAC to switch port mapping.<BR>
|
||||||
|
<UL>
|
||||||
|
<LI><TT>no</TT> - Have not found an SNMP method to get data yet.
|
||||||
|
<LI><TT>yes</TT> - Can get through normal SWITCH-MIB method.
|
||||||
|
<LI><TT>vlan</TT> - Have to re-connect to each VLAN and then fetch with normal
|
||||||
|
method.
|
||||||
|
</UL>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR>
|
||||||
|
<TD>Portmac</TD>
|
||||||
|
<TD>Whether the device will list the MAC address of the switch port on each
|
||||||
|
switch port when doing a Macsuck.
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
|
end_tail
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
sub print_headers {
|
||||||
|
print "<TR>\n";
|
||||||
|
foreach my $a (sort sort_nocase keys %$Attributes) {
|
||||||
|
next if $a eq 'note';
|
||||||
|
print " <TH>$a</TH>\n";
|
||||||
|
}
|
||||||
|
print "</TR>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user