complete the migration of connected device ID to connected inventory

This commit is contained in:
Oliver Gorwits
2018-03-02 12:42:36 +00:00
parent e1b9f2225e
commit 7b5f8c76f3
7 changed files with 146 additions and 57 deletions

View File

@@ -314,7 +314,44 @@ state, or else `undef` if the port is not in an error state.
=cut
sub error_disable_cause { return (shift)->get_column('properties_error_disable_cause') }
sub error_disable_cause { return (shift)->get_column('error_disable_cause') }
=head2 remote_is_wap
Returns true if the remote LLDP neighbor has reported Wireless Access Point
capability.
=cut
sub remote_is_wap { return (shift)->get_column('remote_is_wap') }
=head2 remote_is_phone
Returns true if the remote LLDP neighbor has reported Telephone capability.
=cut
sub remote_is_phone { return (shift)->get_column('remote_is_phone') }
=head2 remote_inventory
Returns a synthesized description of the remote LLDP device if inventory
information was given, including vendor, model, OS version, and serial number.
=cut
sub remote_inventory {
my $port = shift;
my $os_ver = ($port->get_column('remote_os_ver')
? ('running '. $port->get_column('remote_os_ver')) : '');
my $serial = ($port->get_column('remote_serial')
? ('('. $port->get_column('remote_serial') .')') : '');
my $retval = join ' ', ($port->get_column('remote_vendor') || ''),
($port->get_column('remote_model') || ''), $serial, $os_ver;
return (($retval =~ m/[[:alnum:]]/) ? $retval : '');
}
=head2 vlan_count

View File

@@ -19,10 +19,10 @@ __PACKAGE__->add_columns(
{ data_type => "boolean", is_nullable => 1 },
"remote_vendor",
{ data_type => "text", is_nullable => 1 },
"remote_os_ver",
{ data_type => "text", is_nullable => 1 },
"remote_model",
{ data_type => "text", is_nullable => 1 },
"remote_os_ver",
{ data_type => "text", is_nullable => 1 },
"remote_serial",
{ data_type => "text", is_nullable => 1 },
);