Merge branch 'master' into og-autoload
Conflicts: Netdisco/share/config.yml
This commit is contained in:
@@ -4,7 +4,7 @@ use strict;
|
||||
use warnings;
|
||||
use 5.010_000;
|
||||
|
||||
our $VERSION = '2.027007';
|
||||
our $VERSION = '2.028000';
|
||||
use App::Netdisco::Configuration;
|
||||
|
||||
use Module::Find ();
|
||||
|
||||
@@ -169,7 +169,7 @@ sub store_device {
|
||||
$device->model( Encode::decode('UTF-8', $snmp->model) );
|
||||
$device->serial( Encode::decode('UTF-8', $snmp->serial) );
|
||||
|
||||
$device->snmp_class( $snmp->device_type );
|
||||
$device->snmp_class( $snmp->class );
|
||||
$device->last_discover(\'now()');
|
||||
|
||||
schema('netdisco')->txn_do(sub {
|
||||
@@ -216,9 +216,20 @@ sub store_interfaces {
|
||||
# clear the cached uptime and get a new one
|
||||
my $dev_uptime = $snmp->load_uptime;
|
||||
|
||||
# used to track whether we've wrapped the device uptime
|
||||
# used to track how many times the device uptime wrapped
|
||||
my $dev_uptime_wrapped = 0;
|
||||
|
||||
# use SNMP-FRAMEWORK-MIB::snmpEngineTime if available to
|
||||
# fix device uptime if wrapped
|
||||
if (defined $snmp->snmpEngineTime) {
|
||||
$dev_uptime_wrapped = int( $snmp->snmpEngineTime * 100 / 2**32 );
|
||||
if ($dev_uptime_wrapped > 0) {
|
||||
info sprintf ' [%s] interface - device uptime wrapped %d times - correcting',
|
||||
$device->ip, $dev_uptime_wrapped;
|
||||
$device->uptime( $dev_uptime + $dev_uptime_wrapped * 2**32 );
|
||||
}
|
||||
}
|
||||
|
||||
# build device interfaces suitable for DBIC
|
||||
my %interfaces;
|
||||
foreach my $entry (keys %$interfaces) {
|
||||
@@ -264,7 +275,7 @@ sub store_interfaces {
|
||||
debug sprintf
|
||||
' [%s] interfaces - correcting LastChange for %s, assuming sysUptime wrap',
|
||||
$device->ip, $port;
|
||||
$lc += 2**32;
|
||||
$lc += $dev_uptime_wrapped * 2**32;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,13 @@ __PACKAGE__->result_source_instance->view_definition(<<'ENDSQL');
|
||||
FROM subnets s1, node_ip ni
|
||||
WHERE s1.net <<= ?::cidr
|
||||
AND ni.ip <<= s1.net
|
||||
AND ni.time_last >= ?
|
||||
AND ni.time_last <= ?
|
||||
AND ((
|
||||
ni.time_first IS null
|
||||
AND ni.time_last IS null
|
||||
) OR (
|
||||
ni.time_last >= ?
|
||||
AND ni.time_last <= ?
|
||||
))
|
||||
AND s1.last_discover >= ?
|
||||
UNION
|
||||
SELECT DISTINCT net, di.alias as ip
|
||||
|
||||
@@ -294,6 +294,12 @@ Value: Boolean. Default: true.
|
||||
Set to "C<false>" if you MUST maintain backwards compatibility with the Netdisco
|
||||
1.x web interface. Strongly recommended that you leave this set to "C<true>".
|
||||
|
||||
=head3 C<table_pagesize>
|
||||
|
||||
Value: Number. Default: 10.
|
||||
|
||||
The number of rows in a table page.
|
||||
|
||||
=head2 Netdisco Core
|
||||
|
||||
=head3 C<mibhome>
|
||||
|
||||
@@ -62,15 +62,28 @@ You I<must> reconfigure. Old configuration will not be migrated.
|
||||
|
||||
=head1 2.028000
|
||||
|
||||
=head2 General Changes
|
||||
=head2 Incompatible Changes
|
||||
|
||||
The daemons can be started from init scripts, as root. They will drop back
|
||||
from the root user to C<netdisco> before opening logs. However a limitation is
|
||||
that the web frontend might need to keep root status to bind to a specific
|
||||
port (e.g. 80) - the logs will then be created as root user. Sorry about that.
|
||||
|
||||
You might also find when upgrading that previous logs were owned by root and
|
||||
Netdisco now wants to write to them as non-root (C<netdisco>) user. Please
|
||||
either remove the logs before restarting, or alter their ownership.
|
||||
|
||||
Logs can be found in the C<logs> subdirectory of Netdisco's home area.
|
||||
|
||||
=head2 General Notices
|
||||
|
||||
The configuration item C<housekeeping> has been renamed to C<schedule>. Old
|
||||
configuration will continue to work, but we recommend you rename this key in
|
||||
your configuration anyway.
|
||||
configuration will continue to work, but we recommend you now rename this key
|
||||
in your configuration anyway.
|
||||
|
||||
=head1 2.025001
|
||||
|
||||
=head2 General Changes
|
||||
=head2 General Notices
|
||||
|
||||
The Web and Backend daemons (C<netdisco-web> and C<netdisco-daemon>
|
||||
respectively) will now watch your C<deployment.yml> configuration file, and
|
||||
|
||||
@@ -18,15 +18,12 @@ get '/ajax/content/report/subnets' => require_login sub {
|
||||
my $agenot = param('age_invert') || '0';
|
||||
my ( $start, $end ) = param('daterange') =~ /(\d+-\d+-\d+)/gmx;
|
||||
|
||||
if ($agenot) {
|
||||
my $tmp = $end;
|
||||
$end = $start;
|
||||
$start = $tmp;
|
||||
}
|
||||
$start = $start . ' 00:00:00';
|
||||
$end = $end . ' 23:59:59';
|
||||
|
||||
my @results = schema('netdisco')->resultset('Virtual::SubnetUtilization')
|
||||
->search(undef,{
|
||||
bind => [ $subnet, $start, $end, $end, $subnet, $end, $end ],
|
||||
bind => [ $subnet, $start, $end, $start, $subnet, $start, $start ],
|
||||
})->hri->all;
|
||||
|
||||
return unless scalar @results;
|
||||
|
||||
Reference in New Issue
Block a user