Merge branch 'master' of https://github.com/netdisco/netdisco
This commit is contained in:
@@ -11,7 +11,7 @@ __PACKAGE__->load_namespaces(
|
|||||||
);
|
);
|
||||||
|
|
||||||
our # try to hide from kwalitee
|
our # try to hide from kwalitee
|
||||||
$VERSION = 53; # schema version used for upgrades, keep as integer
|
$VERSION = 54; # schema version used for upgrades, keep as integer
|
||||||
|
|
||||||
use Path::Class;
|
use Path::Class;
|
||||||
use File::ShareDir 'dist_dir';
|
use File::ShareDir 'dist_dir';
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ __PACKAGE__->add_columns(
|
|||||||
{ data_type => "bigint", is_nullable => 1 },
|
{ data_type => "bigint", is_nullable => 1 },
|
||||||
"faststart",
|
"faststart",
|
||||||
{ data_type => "boolean", is_nullable => 1 },
|
{ data_type => "boolean", is_nullable => 1 },
|
||||||
|
"ifindex",
|
||||||
|
{ data_type => "bigint", is_nullable => 1 },
|
||||||
);
|
);
|
||||||
__PACKAGE__->set_primary_key("port", "ip");
|
__PACKAGE__->set_primary_key("port", "ip");
|
||||||
|
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ sub delete_device {
|
|||||||
=head2 renumber_device( $current_ip, $new_ip )
|
=head2 renumber_device( $current_ip, $new_ip )
|
||||||
|
|
||||||
Will update all records in Netdisco referring to the device with
|
Will update all records in Netdisco referring to the device with
|
||||||
C<$current_ip> to use C<$new_ip> instead, followed by renumbering the device
|
C<$current_ip> to use C<$new_ip> instead, followed by renumbering the
|
||||||
iteself.
|
device itself.
|
||||||
|
|
||||||
Returns true if the transaction completes, else returns false.
|
Returns true if the transaction completes, else returns false.
|
||||||
|
|
||||||
|
|||||||
@@ -101,6 +101,17 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
|
|||||||
$properties{ $port }->{remote_serial} = $rem_serial->{ $idx };
|
$properties{ $port }->{remote_serial} = $rem_serial->{ $idx };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach my $idx (keys %$interfaces) {
|
||||||
|
my $port = $interfaces->{$idx} or next;
|
||||||
|
if (!defined $device_ports->{$port}) {
|
||||||
|
debug sprintf ' [%s] properties/ifindex - local port %s already skipped, ignoring',
|
||||||
|
$device->ip, $port;
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
$properties{ $port }->{ifindex} = $idx;
|
||||||
|
}
|
||||||
|
|
||||||
return Status->info(" [$device] no port properties to record")
|
return Status->info(" [$device] no port properties to record")
|
||||||
unless scalar keys %properties;
|
unless scalar keys %properties;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
BEGIN;
|
||||||
|
|
||||||
|
ALTER TABLE device_port_properties ADD COLUMN "ifindex" bigint;
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
Reference in New Issue
Block a user