rename housekeeping to schedule
This commit is contained in:
@@ -54,7 +54,7 @@ sub build_tasks_list {
|
||||
push @$tasks, {
|
||||
max_workers => 1,
|
||||
user_begin => worker_factory('Scheduler'),
|
||||
} if setting('housekeeping');
|
||||
} if setting('schedule');
|
||||
|
||||
my @logmsg = ();
|
||||
foreach my $key (keys %{setting('job_type_keys')}) {
|
||||
@@ -72,7 +72,7 @@ sub build_tasks_list {
|
||||
|
||||
info sprintf "MCE will load: %s Manager, %s Scheduler, %s",
|
||||
(num_workers() ? 1 : 0),
|
||||
(setting('housekeeping') ? 1 : 0),
|
||||
(setting('schedule') ? 1 : 0),
|
||||
(join ', ', @logmsg);
|
||||
|
||||
return $tasks;
|
||||
|
||||
@@ -151,7 +151,7 @@ In the same file uncomment and edit the C<domain_suffix> setting to be
|
||||
appropriate for your local site.
|
||||
|
||||
Change the C<community> string setting if your site has different values, and
|
||||
uncomment the C<housekeeping> setting to enable SNMP data gathering from
|
||||
uncomment the C<schedule> setting to enable SNMP data gathering from
|
||||
devices (this replaces cron jobs in Netdisco 1).
|
||||
|
||||
Have a quick read of the other settings to make sure you're happy, then move
|
||||
|
||||
@@ -13,8 +13,8 @@ sub worker_begin {
|
||||
my $wid = $self->wid;
|
||||
debug "entering Scheduler ($wid) worker_begin()";
|
||||
|
||||
foreach my $action (keys %{ setting('housekeeping') }) {
|
||||
my $config = setting('housekeeping')->{$action};
|
||||
foreach my $action (keys %{ setting('schedule') }) {
|
||||
my $config = setting('schedule')->{$action};
|
||||
|
||||
# accept either single crontab format, or individual time fields
|
||||
$config->{when} = Algorithm::Cron->new(
|
||||
@@ -43,8 +43,8 @@ sub worker_body {
|
||||
my $win_end = $win_start + 60;
|
||||
|
||||
# if any job is due, add it to the queue
|
||||
foreach my $action (keys %{ setting('housekeeping') }) {
|
||||
my $sched = setting('housekeeping')->{$action};
|
||||
foreach my $action (keys %{ setting('schedule') }) {
|
||||
my $sched = setting('schedule')->{$action};
|
||||
|
||||
# next occurence of job must be in this minute's window
|
||||
debug sprintf "sched ($wid): $action: win_start: %s, win_end: %s, next: %s",
|
||||
|
||||
@@ -46,9 +46,9 @@ setting('workers')->{queue} ||= 'PostgreSQL';
|
||||
setting('dns')->{hosts_file} ||= '/etc/hosts';
|
||||
setting('dns')->{no} ||= ['fe80::/64','169.254.0.0/16'];
|
||||
|
||||
# housekeeping expire used to be called expiry
|
||||
setting('housekeeping')->{expire} ||= setting('housekeeping')->{expiry}
|
||||
if setting('housekeeping') and exists setting('housekeeping')->{expiry};
|
||||
# schedule expire used to be called expiry
|
||||
setting('schedule')->{expire} ||= setting('schedule')->{expiry}
|
||||
if setting('schedule') and exists setting('schedule')->{expiry};
|
||||
|
||||
# set max outstanding requests for AnyEvent::DNS
|
||||
$ENV{'PERL_ANYEVENT_MAX_OUTSTANDING_DNS'}
|
||||
|
||||
@@ -870,7 +870,7 @@ library default of 10.
|
||||
C<no> is a list of IP addresses or CIDR ranges to excluded from DNS
|
||||
resolution. Link local addresses are excluded by default.
|
||||
|
||||
=head3 C<housekeeping>
|
||||
=head3 C<schedule>
|
||||
|
||||
Value: Settings Tree. Default: None.
|
||||
|
||||
@@ -879,13 +879,13 @@ macsuck, arpnip, etc) in the central database. It's fine to have multiple
|
||||
nodes scheduling work for redundancy (but make sure they all have good NTP).
|
||||
|
||||
Note that this is independent of the Pollers configured in C<workers>. It's
|
||||
okay to have this node schedule housekeeping but not do any of the polling
|
||||
okay to have this node schedule schedule but not do any of the polling
|
||||
itself (C<pollers: 0>).
|
||||
|
||||
Work can be scheduled using C<cron> style notation, or a simple weekday and
|
||||
hour fields (which accept same types as C<cron> notation). For example:
|
||||
|
||||
housekeeping:
|
||||
schedule:
|
||||
discoverall:
|
||||
when: '0 9 * * *'
|
||||
arpwalk:
|
||||
|
||||
@@ -440,7 +440,7 @@ each).
|
||||
The fourth kind of worker is called the Scheduler and takes care of adding
|
||||
discover, macsuck, arpnip, and nbtstat jobs to the queue (which are in turn
|
||||
handled by the Poller worker). This worker is automatically started only if
|
||||
the user has enabled the "C<housekeeping>" section of their
|
||||
the user has enabled the "C<schedule>" section of their
|
||||
C<deployment.yml> site config.
|
||||
|
||||
=head2 SNMP::Info
|
||||
|
||||
@@ -36,6 +36,14 @@ but they are backwards compatible.
|
||||
|
||||
=back
|
||||
|
||||
=head1 2.028000
|
||||
|
||||
=head2 General Changes
|
||||
|
||||
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.
|
||||
|
||||
=head1 2.025001
|
||||
|
||||
=head2 General Changes
|
||||
|
||||
@@ -174,7 +174,7 @@ dns:
|
||||
hosts_file: '/etc/hosts'
|
||||
no: ['fe80::/64','169.254.0.0/16']
|
||||
|
||||
#housekeeping:
|
||||
#schedule:
|
||||
# discoverall:
|
||||
# when: '5 7 * * *'
|
||||
# macwalk:
|
||||
|
||||
@@ -42,7 +42,7 @@ snmp_auth:
|
||||
|
||||
# daemon will keep netdisco up to date on this schedule
|
||||
# `````````````````````````````````````````````````````
|
||||
#housekeeping:
|
||||
#schedule:
|
||||
# discoverall:
|
||||
# when: '5 7 * * *'
|
||||
# macwalk:
|
||||
|
||||
Reference in New Issue
Block a user