Require SNMP::Info 3.10+, use new c_cap method to tag device remote_type as 'IP Phone:' or 'AP:' when those capabilities are advertised by LLDP or CDP
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2.030000 -
|
||||||
|
|
||||||
|
[ENHANCEMENTS]
|
||||||
|
|
||||||
|
* Require SNMP::Info 3.10+, use new c_cap method to tag device remote_type
|
||||||
|
as 'IP Phone:' or 'AP:' when those capabilities are advertised by LLDP
|
||||||
|
or CDP
|
||||||
|
|
||||||
2.020002 - 2013-12-11
|
2.020002 - 2013-12-11
|
||||||
|
|
||||||
[NEW FEATURES]
|
[NEW FEATURES]
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ requires 'Plack::Middleware::Expires' => 0.03;
|
|||||||
requires 'Role::Tiny' => 1.002005;
|
requires 'Role::Tiny' => 1.002005;
|
||||||
requires 'Socket6' => 0.23;
|
requires 'Socket6' => 0.23;
|
||||||
requires 'Starman' => 0.4008;
|
requires 'Starman' => 0.4008;
|
||||||
requires 'SNMP::Info' => 3.08;
|
requires 'SNMP::Info' => 3.10;
|
||||||
requires 'SQL::Translator' => 0.11016;
|
requires 'SQL::Translator' => 0.11016;
|
||||||
requires 'Template' => 2.24;
|
requires 'Template' => 2.24;
|
||||||
requires 'Template::Plugin::CSV' => 0.04;
|
requires 'Template::Plugin::CSV' => 0.04;
|
||||||
|
|||||||
@@ -617,7 +617,7 @@ sub store_neighbors {
|
|||||||
my ($device, $snmp) = @_;
|
my ($device, $snmp) = @_;
|
||||||
my @to_discover = ();
|
my @to_discover = ();
|
||||||
|
|
||||||
# first allow any manually configred topology to be set
|
# first allow any manually configured topology to be set
|
||||||
_set_manual_topology($device, $snmp);
|
_set_manual_topology($device, $snmp);
|
||||||
|
|
||||||
my $c_ip = $snmp->c_ip;
|
my $c_ip = $snmp->c_ip;
|
||||||
@@ -631,6 +631,7 @@ sub store_neighbors {
|
|||||||
my $c_port = $snmp->c_port;
|
my $c_port = $snmp->c_port;
|
||||||
my $c_id = $snmp->c_id;
|
my $c_id = $snmp->c_id;
|
||||||
my $c_platform = $snmp->c_platform;
|
my $c_platform = $snmp->c_platform;
|
||||||
|
my $c_cap = $snmp->c_cap;
|
||||||
|
|
||||||
foreach my $entry (keys %$c_ip) {
|
foreach my $entry (keys %$c_ip) {
|
||||||
my $port = $interfaces->{ $c_if->{$entry} };
|
my $port = $interfaces->{ $c_if->{$entry} };
|
||||||
@@ -645,6 +646,7 @@ sub store_neighbors {
|
|||||||
my $remote_port = undef;
|
my $remote_port = undef;
|
||||||
my $remote_type = $c_platform->{$entry};
|
my $remote_type = $c_platform->{$entry};
|
||||||
my $remote_id = Encode::decode('UTF-8', $c_id->{$entry});
|
my $remote_id = Encode::decode('UTF-8', $c_id->{$entry});
|
||||||
|
my $remote_cap = $c_cap->{$entry} || [];
|
||||||
|
|
||||||
next unless $remote_ip;
|
next unless $remote_ip;
|
||||||
|
|
||||||
@@ -684,13 +686,20 @@ sub store_neighbors {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# IP Phone detection type fixup
|
# IP Phone and WAP detection type fixup
|
||||||
if (defined $remote_type and $remote_type =~ m/(mitel.5\d{3})/i) {
|
if (defined $remote_type) {
|
||||||
$remote_type = 'IP Phone - '. $remote_type
|
my $phone_flag = grep {/phone/i} @$remote_cap;
|
||||||
|
my $ap_flag = grep {/wlanAccessPoint/} @$remote_cap;
|
||||||
|
if ($phone_flag or $remote_type =~ m/(mitel.5\d{3})/i) {
|
||||||
|
$remote_type = 'IP Phone: '. $remote_type
|
||||||
if $remote_type !~ /ip phone/i;
|
if $remote_type !~ /ip phone/i;
|
||||||
}
|
}
|
||||||
else {
|
elsif ($ap_flag) {
|
||||||
|
$remote_type = 'AP: '. $remote_type;
|
||||||
|
}
|
||||||
|
else {
|
||||||
$remote_type ||= '';
|
$remote_type ||= '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# hack for devices seeing multiple neighbors on the port
|
# hack for devices seeing multiple neighbors on the port
|
||||||
|
|||||||
Reference in New Issue
Block a user