Merge branch 'master' into og-coreplugins
This commit is contained in:
2
Build.PL
2
Build.PL
@@ -55,6 +55,8 @@ Module::Build->new(
|
|||||||
'Opcode' => '1.07',
|
'Opcode' => '1.07',
|
||||||
'Path::Class' => '0.32',
|
'Path::Class' => '0.32',
|
||||||
'Plack' => '1.0023',
|
'Plack' => '1.0023',
|
||||||
|
'Plack::Handler::Twiggy' => '0',
|
||||||
|
'Plack::Middleware::Debug' => '0',
|
||||||
'Plack::Middleware::Expires' => '0.03',
|
'Plack::Middleware::Expires' => '0.03',
|
||||||
'Plack::Middleware::ReverseProxy' => '0.15',
|
'Plack::Middleware::ReverseProxy' => '0.15',
|
||||||
'Pod::Usage' => 0,
|
'Pod::Usage' => 0,
|
||||||
|
|||||||
@@ -53,6 +53,13 @@ if (ref {} eq ref setting('database')) {
|
|||||||
# always set this
|
# always set this
|
||||||
$ENV{DBIC_TRACE_PROFILE} = 'console';
|
$ENV{DBIC_TRACE_PROFILE} = 'console';
|
||||||
|
|
||||||
|
# if snmp_auth or device_auth not set, add defaults to community{_rw}
|
||||||
|
if ((setting('snmp_auth') and 0 == scalar @{ setting('snmp_auth') })
|
||||||
|
or (setting('device_auth') and 0 == scalar @{ setting('device_auth') })) {
|
||||||
|
config->{'community'} = [ @{setting('community')}, 'public' ];
|
||||||
|
config->{'community_rw'} = [ @{setting('community_rw')}, 'private' ];
|
||||||
|
}
|
||||||
|
|
||||||
# defaults for workers
|
# defaults for workers
|
||||||
setting('workers')->{queue} ||= 'PostgreSQL';
|
setting('workers')->{queue} ||= 'PostgreSQL';
|
||||||
if (exists setting('workers')->{interactives}
|
if (exists setting('workers')->{interactives}
|
||||||
|
|||||||
@@ -90,6 +90,17 @@ __PACKAGE__->has_many( device_skips => 'App::Netdisco::DB::Result::DeviceSkip',
|
|||||||
{ cascade_copy => 0, cascade_update => 0, cascade_delete => 0 }
|
{ cascade_copy => 0, cascade_update => 0, cascade_delete => 0 }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
=head2 target
|
||||||
|
|
||||||
|
Returns the single C<device> to which this Job entry was associated.
|
||||||
|
|
||||||
|
The JOIN is of type LEFT, in case the C<device> is not in the database.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
__PACKAGE__->belongs_to( target => 'App::Netdisco::DB::Result::Device',
|
||||||
|
{ 'foreign.ip' => 'self.device' }, { join_type => 'LEFT' } );
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
=head2 summary
|
=head2 summary
|
||||||
|
|||||||
@@ -251,6 +251,7 @@ sub jq_complete {
|
|||||||
|
|
||||||
sub jq_log {
|
sub jq_log {
|
||||||
return schema('netdisco')->resultset('Admin')->search({}, {
|
return schema('netdisco')->resultset('Admin')->search({}, {
|
||||||
|
prefetch => 'target',
|
||||||
order_by => { -desc => [qw/entered device action/] },
|
order_by => { -desc => [qw/entered device action/] },
|
||||||
rows => 50,
|
rows => 50,
|
||||||
})->with_times->hri->all;
|
})->with_times->hri->all;
|
||||||
|
|||||||
@@ -28,8 +28,9 @@ foreach my $report (@{setting('reports')}) {
|
|||||||
|
|
||||||
my $schema = ($report->{database} || 'netdisco');
|
my $schema = ($report->{database} || 'netdisco');
|
||||||
my $rs = schema($schema)->resultset('Virtual::GenericReport')->result_source;
|
my $rs = schema($schema)->resultset('Virtual::GenericReport')->result_source;
|
||||||
|
(my $query = $report->{query}) =~ s/;$//;
|
||||||
|
|
||||||
$rs->view_definition($report->{query});
|
$rs->view_definition($query);
|
||||||
$rs->remove_columns($rs->columns);
|
$rs->remove_columns($rs->columns);
|
||||||
$rs->add_columns( exists $report->{query_columns}
|
$rs->add_columns( exists $report->{query_columns}
|
||||||
? @{ $report->{query_columns} }
|
? @{ $report->{query_columns} }
|
||||||
|
|||||||
@@ -124,9 +124,9 @@ host_groups:
|
|||||||
- 'fe80::/10'
|
- 'fe80::/10'
|
||||||
- '127.0.0.0/8'
|
- '127.0.0.0/8'
|
||||||
device_identity: []
|
device_identity: []
|
||||||
community: ['public']
|
community: []
|
||||||
community_rw: ['private']
|
community_rw: []
|
||||||
device_auth: []
|
snmp_auth: []
|
||||||
get_community: ""
|
get_community: ""
|
||||||
bulkwalk_off: false
|
bulkwalk_off: false
|
||||||
bulkwalk_no: []
|
bulkwalk_no: []
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
[% IF row.action == 'discover' AND row.status == 'error' %]
|
[% IF row.action == 'discover' AND row.status == 'error' %]
|
||||||
<a href="[% uri_for('/') %]?device=[% row.device | uri %]">[% row.device | html_entity %]</a>
|
<a href="[% uri_for('/') %]?device=[% row.device | uri %]">[% row.device | html_entity %]</a>
|
||||||
[% ELSE %]
|
[% ELSE %]
|
||||||
<a href="[% uri_for('/device') %]?q=[% row.device | uri %]">[% row.device | html_entity %]</a>
|
<a href="[% uri_for('/device') %]?q=[% row.device | uri %]">[% row.target.dns || row.device | html_entity %]</a>
|
||||||
[% END %]
|
[% END %]
|
||||||
</td>
|
</td>
|
||||||
<td class="nd_center-cell">[% row.port | html_entity %]</td>
|
<td class="nd_center-cell">[% row.port | html_entity %]</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user