PR for #510 - store ifindex in device_port

This commit is contained in:
ram
2019-02-21 22:15:12 +01:00
committed by Christian Ramseyer
parent 1620feaa6a
commit 24a7e80470
4 changed files with 9 additions and 1 deletions

View File

@@ -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';

View File

@@ -69,6 +69,8 @@ __PACKAGE__->add_columns(
{ data_type => "integer", is_nullable => 1 }, { data_type => "integer", is_nullable => 1 },
"lastchange", "lastchange",
{ data_type => "bigint", is_nullable => 1 }, { data_type => "bigint", is_nullable => 1 },
"ifindex",
{ data_type => "bigint", is_nullable => 1 },
); );
__PACKAGE__->set_primary_key("port", "ip"); __PACKAGE__->set_primary_key("port", "ip");

View File

@@ -229,6 +229,7 @@ register_worker({ phase => 'early', driver => 'snmp' }, sub {
type => $i_type->{$entry}, type => $i_type->{$entry},
vlan => $i_vlan->{$entry}, vlan => $i_vlan->{$entry},
pvid => $i_vlan->{$entry}, pvid => $i_vlan->{$entry},
ifindex => $entry,
is_master => 'false', is_master => 'false',
slave_of => undef, slave_of => undef,
lastchange => $lc, lastchange => $lc,

View File

@@ -0,0 +1,5 @@
BEGIN;
ALTER TABLE device_port ADD COLUMN "ifindex" bigint;
COMMIT;