Change location of ifindex to DevicePortProperties
* instead of DevicePort * as requested by Oliver in PR #513 review
This commit is contained in:
@@ -69,8 +69,6 @@ __PACKAGE__->add_columns(
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"lastchange",
|
||||
{ data_type => "bigint", is_nullable => 1 },
|
||||
"ifindex",
|
||||
{ data_type => "bigint", is_nullable => 1 },
|
||||
);
|
||||
__PACKAGE__->set_primary_key("port", "ip");
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ __PACKAGE__->add_columns(
|
||||
{ data_type => "bigint", is_nullable => 1 },
|
||||
"faststart",
|
||||
{ data_type => "boolean", is_nullable => 1 },
|
||||
"ifindex",
|
||||
{ data_type => "bigint", is_nullable => 1 },
|
||||
);
|
||||
__PACKAGE__->set_primary_key("port", "ip");
|
||||
|
||||
|
||||
@@ -101,6 +101,17 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
|
||||
$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")
|
||||
unless scalar keys %properties;
|
||||
|
||||
|
||||
@@ -229,7 +229,6 @@ register_worker({ phase => 'early', driver => 'snmp' }, sub {
|
||||
type => $i_type->{$entry},
|
||||
vlan => $i_vlan->{$entry},
|
||||
pvid => $i_vlan->{$entry},
|
||||
ifindex => $entry,
|
||||
is_master => 'false',
|
||||
slave_of => undef,
|
||||
lastchange => $lc,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE device_port ADD COLUMN "ifindex" bigint;
|
||||
ALTER TABLE device_port_properties ADD COLUMN "ifindex" bigint;
|
||||
|
||||
COMMIT;
|
||||
|
||||
Reference in New Issue
Block a user