-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial version of node_ip_l3device patch
* allows tracking of L3 device arp origin * new table and schema object for node_ip_l3device * Arpnip.pm and netdisco-sshcollector support * usage is enable through arpnip_track_l3device setting * more info in https://github.com/rc9000/nd2_private_patches/wiki
- Loading branch information
Showing
6 changed files
with
191 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
use utf8; | ||
package App::Netdisco::DB::Result::NodeIpL3device; | ||
|
||
# Created by DBIx::Class::Schema::Loader | ||
# DO NOT MODIFY THE FIRST PART OF THIS FILE | ||
|
||
=head1 NAME | ||
App::Netdisco::DB::Result::NodeIpL3device | ||
=cut | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use base 'DBIx::Class::Core'; | ||
|
||
=head1 TABLE: C<node_ip_l3device> | ||
=cut | ||
|
||
__PACKAGE__->table("node_ip_l3device"); | ||
|
||
=head1 ACCESSORS | ||
=head2 node_mac | ||
data_type: 'macaddr' | ||
is_nullable: 0 | ||
=head2 node_ip | ||
data_type: 'inet' | ||
is_nullable: 0 | ||
=head2 device_ip | ||
data_type: 'inet' | ||
is_nullable: 0 | ||
=head2 time_first | ||
data_type: 'timestamp' | ||
default_value: current_timestamp | ||
is_nullable: 1 | ||
original: {default_value => \"now()"} | ||
=head2 time_last | ||
data_type: 'timestamp' | ||
default_value: current_timestamp | ||
is_nullable: 1 | ||
original: {default_value => \"now()"} | ||
=cut | ||
|
||
__PACKAGE__->add_columns( | ||
"node_mac", | ||
{ data_type => "macaddr", is_nullable => 0 }, | ||
"node_ip", | ||
{ data_type => "inet", is_nullable => 0 }, | ||
"device_ip", | ||
{ data_type => "inet", is_nullable => 0 }, | ||
"time_first", | ||
{ | ||
data_type => "timestamp", | ||
default_value => \"current_timestamp", | ||
is_nullable => 1, | ||
original => { default_value => \"now()" }, | ||
}, | ||
"time_last", | ||
{ | ||
data_type => "timestamp", | ||
default_value => \"current_timestamp", | ||
is_nullable => 1, | ||
original => { default_value => \"now()" }, | ||
}, | ||
); | ||
|
||
=head1 PRIMARY KEY | ||
=over 4 | ||
=item * L</node_mac> | ||
=item * L</node_ip> | ||
=item * L</device_ip> | ||
=back | ||
=cut | ||
|
||
__PACKAGE__->set_primary_key("node_mac", "node_ip", "device_ip"); | ||
|
||
|
||
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2016-11-09 23:03:08 | ||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eTQlbkByATRqTPO3W8Rosg | ||
|
||
|
||
# You can replace this text with custom code or comments, and it will be preserved on regeneration | ||
1; |
18 changes: 18 additions & 0 deletions
18
Netdisco/lib/App/Netdisco/DB/schema_versions/App-Netdisco-DB-41-42-PostgreSQL.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
BEGIN; | ||
|
||
CREATE TABLE node_ip_l3device | ||
( | ||
node_mac macaddr NOT NULL, | ||
node_ip inet NOT NULL, | ||
device_ip inet NOT NULL, | ||
time_first timestamp without time zone DEFAULT now(), | ||
time_last timestamp without time zone DEFAULT now(), | ||
CONSTRAINT node_ip_l3device_pkey PRIMARY KEY (node_mac, node_ip, device_ip) | ||
) | ||
WITH ( | ||
OIDS=FALSE | ||
); | ||
ALTER TABLE node_ip_l3device | ||
OWNER TO netdisco; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters