diff --git a/Netdisco/lib/App/Netdisco/Daemon/Worker/Poller.pm b/Netdisco/lib/App/Netdisco/Daemon/Worker/Poller.pm index 3ca0c592..f40b1f9e 100644 --- a/Netdisco/lib/App/Netdisco/Daemon/Worker/Poller.pm +++ b/Netdisco/lib/App/Netdisco/Daemon/Worker/Poller.pm @@ -8,7 +8,7 @@ use Role::Tiny; use namespace::clean; # add dispatch methods for poller tasks -with 'App::Netdisco::Daemon::Worker::Poller::Discover'; +# with 'App::Netdisco::Daemon::Worker::Poller::Discover'; sub worker_body { my $self = shift; diff --git a/Netdisco/lib/App/Netdisco/Daemon/Worker/Scheduler.pm b/Netdisco/lib/App/Netdisco/Daemon/Worker/Scheduler.pm index cf08b6ad..5cc05923 100644 --- a/Netdisco/lib/App/Netdisco/Daemon/Worker/Scheduler.pm +++ b/Netdisco/lib/App/Netdisco/Daemon/Worker/Scheduler.pm @@ -31,10 +31,10 @@ sub worker_begin { my $config = setting('housekeeping')->{$a}; # accept either single crontab format, or individual time fields - my $cron = Algorithm::Cron->new(@{ - ref [] eq ref $config->{when} + my $cron = Algorithm::Cron->new(%{ + ref {} eq ref $config->{when} ? $config->{when} - : [crontab => $config->{when}]; + : {crontab => $config->{when}} }); $jobactions->{$a} = $config; @@ -71,7 +71,7 @@ sub worker_body { schema('netdisco')->resultset('Admin')->create({ action => $a, device => ($sched->{device} || undef), - subaction => ($sched->{extra} || undef), + subaction => ($sched->{param} || undef), status => 'queued', }); }; diff --git a/Netdisco/share/config.yml b/Netdisco/share/config.yml index 657978b4..de7fb0ca 100644 --- a/Netdisco/share/config.yml +++ b/Netdisco/share/config.yml @@ -70,8 +70,32 @@ portctl_vlans: 1 # sleep time between polls of the database job queue daemon_sleep_time: 5 -# how many daemon processes -# NB one worker will always be a Queue Manager +# how many daemon processes for this node daemon_interactives: 2 -daemon_pollers: 0 +daemon_pollers: 2 +# what housekeeping tasks should this node *schedule* +# (it only does them if daemon_pollers is non-zero) +#housekeeping: +# discoverall: +# device: '192.0.2.0' +# when: +# wday: 'wed' +# hour: 14 +# backup: +# when: +# hour: 1 +# refresh: +# when: '0 9 * * *' +# arpwalk: +# when: +# min: 30 +# macwalk: +# when: +# hour: '*/2' +# nbtwalk: +# when: +# hour: '8,13,21' +# saveconfigs: +# param: 61 +# when: '0 * * * *'