support for discover_min_age
This commit is contained in:
@@ -3,7 +3,6 @@ package App::Netdisco::Daemon::Worker::Manager;
|
||||
use Dancer qw/:moose :syntax :script/;
|
||||
use Dancer::Plugin::DBIC 'schema';
|
||||
|
||||
use App::Netdisco::Util::Device 'is_discoverable';
|
||||
use Net::Domain 'hostfqdn';
|
||||
use Try::Tiny;
|
||||
|
||||
@@ -57,10 +56,6 @@ sub worker_body {
|
||||
while (my $job = $rs->next) {
|
||||
my $jid = $job->job;
|
||||
|
||||
# filter for discover_*
|
||||
next unless is_discoverable($job->device);
|
||||
debug sprintf "mgr (%s): job %s is discoverable", $wid, $jid;
|
||||
|
||||
# check for available local capacity
|
||||
next unless $self->do('capacity_for', $job->action);
|
||||
debug sprintf "mgr (%s): processing node has capacity for job %s (%s)",
|
||||
|
||||
@@ -4,7 +4,7 @@ use Dancer qw/:moose :syntax :script/;
|
||||
use Dancer::Plugin::DBIC 'schema';
|
||||
|
||||
use App::Netdisco::Util::SNMP 'snmp_connect';
|
||||
use App::Netdisco::Util::Device 'get_device';
|
||||
use App::Netdisco::Util::Device qw/get_device is_discoverable/;
|
||||
use App::Netdisco::Core::Discover ':all';
|
||||
use App::Netdisco::Daemon::Util ':all';
|
||||
|
||||
@@ -59,7 +59,11 @@ sub discover {
|
||||
|
||||
if ($device->in_storage
|
||||
and $device->vendor and $device->vendor eq 'netdisco') {
|
||||
return job_done("Skipped discover for pseudo-device $host");
|
||||
return job_done("discover skipped: $host is pseudo-device");
|
||||
}
|
||||
|
||||
unless (is_discoverable($device->ip)) {
|
||||
return job_defer("discover deferred: $host is not discoverable");
|
||||
}
|
||||
|
||||
my $snmp = snmp_connect($device);
|
||||
|
||||
Reference in New Issue
Block a user