Merge branch 'master' into og-coreplugins

This commit is contained in:
Oliver Gorwits
2017-08-14 18:10:29 +01:00
10 changed files with 70 additions and 38 deletions

View File

@@ -4,7 +4,7 @@ use strict;
use warnings;
use 5.010_000;
our $VERSION = '2.036007';
our $VERSION = '2.036009';
use App::Netdisco::Configuration;
=head1 NAME

View File

@@ -96,7 +96,7 @@ sub search_aliases {
{
order_by => [qw/ me.dns me.ip /],
join => 'device_ips',
group_by => 'me.ip',
distinct => 1,
}
);
}

View File

@@ -12,6 +12,12 @@ The LLDP configuration should look like:
interface all;
}
=head1 Neighbor Relations on D-Link
Add the following to your devices (changing the port numbers appropriately):
config lldp ports 1-28 mgt_addr ipv4 enable
=head1 VRFs and NXOS
Netdsico at this time does not support VRFs. In particular, overlapping IP

View File

@@ -34,9 +34,8 @@ sub _add_children {
var('seen')->{$c}++;
push @legit, $c;
push @{$ptr}, {
name => _get_name($c),
fullname => (var('devices')->{$c} || $c),
ip => $c,
name => _get_name($c),
};
}
@@ -93,8 +92,7 @@ get '/ajax/data/device/netmap' => require_login sub {
my %tree = (
ip => $start,
name => _get_name($start),
fullname => (var('devices')->{$start} || $start),
name => _get_name($start), # dns or sysname or ip
children => [],
);
@@ -107,20 +105,13 @@ get '/ajax/data/device/netmap' => require_login sub {
};
ajax '/ajax/data/device/alldevicelinks' => require_login sub {
my @devices = schema('netdisco')->resultset('Device')->search({}, {
result_class => 'DBIx::Class::ResultClass::HashRefInflator',
columns => ['ip', 'dns'],
})->all;
var(devices => { map { $_->{ip} => $_->{dns} } @devices });
my $rs = schema('netdisco')->resultset('Virtual::DeviceLinks')->search({}, {
result_class => 'DBIx::Class::ResultClass::HashRefInflator',
});
my %tree = ();
while (my $l = $rs->next) {
push @{ $tree{ _get_name($l->{left_ip} )} },
_get_name($l->{right_ip});
push @{ $tree{ $l->{left_ip} } }, $l->{right_ip};
}
content_type('application/json');