From 2c6f0dd0f7d66759d11bab6f71defb0b7d2b4ea1 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 17 May 2014 19:11:50 +0100 Subject: [PATCH] rename housekeeping to schedule --- Netdisco/bin/netdisco-daemon-fg | 4 ++-- Netdisco/lib/App/Netdisco.pm | 2 +- Netdisco/lib/App/Netdisco/Daemon/Worker/Scheduler.pm | 8 ++++---- Netdisco/lib/App/Netdisco/DefaultSettings.pm | 6 +++--- Netdisco/lib/App/Netdisco/Manual/Configuration.pod | 6 +++--- Netdisco/lib/App/Netdisco/Manual/Developing.pod | 2 +- Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod | 8 ++++++++ Netdisco/share/config.yml | 2 +- Netdisco/share/environments/deployment.yml | 2 +- 9 files changed, 24 insertions(+), 16 deletions(-) diff --git a/Netdisco/bin/netdisco-daemon-fg b/Netdisco/bin/netdisco-daemon-fg index 8b3e9ec9..6b763ab6 100755 --- a/Netdisco/bin/netdisco-daemon-fg +++ b/Netdisco/bin/netdisco-daemon-fg @@ -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; diff --git a/Netdisco/lib/App/Netdisco.pm b/Netdisco/lib/App/Netdisco.pm index e93db31b..42bbf08b 100644 --- a/Netdisco/lib/App/Netdisco.pm +++ b/Netdisco/lib/App/Netdisco.pm @@ -151,7 +151,7 @@ In the same file uncomment and edit the C setting to be appropriate for your local site. Change the C string setting if your site has different values, and -uncomment the C setting to enable SNMP data gathering from +uncomment the C 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 diff --git a/Netdisco/lib/App/Netdisco/Daemon/Worker/Scheduler.pm b/Netdisco/lib/App/Netdisco/Daemon/Worker/Scheduler.pm index e39671ff..218798ac 100644 --- a/Netdisco/lib/App/Netdisco/Daemon/Worker/Scheduler.pm +++ b/Netdisco/lib/App/Netdisco/Daemon/Worker/Scheduler.pm @@ -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", diff --git a/Netdisco/lib/App/Netdisco/DefaultSettings.pm b/Netdisco/lib/App/Netdisco/DefaultSettings.pm index 9487f2ac..0af964f1 100644 --- a/Netdisco/lib/App/Netdisco/DefaultSettings.pm +++ b/Netdisco/lib/App/Netdisco/DefaultSettings.pm @@ -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'} diff --git a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod index f8599c7e..d691f6da 100644 --- a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod +++ b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod @@ -870,7 +870,7 @@ library default of 10. C is a list of IP addresses or CIDR ranges to excluded from DNS resolution. Link local addresses are excluded by default. -=head3 C +=head3 C 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. 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). Work can be scheduled using C style notation, or a simple weekday and hour fields (which accept same types as C notation). For example: - housekeeping: + schedule: discoverall: when: '0 9 * * *' arpwalk: diff --git a/Netdisco/lib/App/Netdisco/Manual/Developing.pod b/Netdisco/lib/App/Netdisco/Manual/Developing.pod index e40eace7..dea39857 100644 --- a/Netdisco/lib/App/Netdisco/Manual/Developing.pod +++ b/Netdisco/lib/App/Netdisco/Manual/Developing.pod @@ -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" section of their +the user has enabled the "C" section of their C site config. =head2 SNMP::Info diff --git a/Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod b/Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod index afaa18ee..2115019a 100644 --- a/Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod +++ b/Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod @@ -36,6 +36,14 @@ but they are backwards compatible. =back +=head1 2.028000 + +=head2 General Changes + +The configuration item C has been renamed to C. Old +configuration will continue to work, but we recommend you rename this key in +your configuration anyway. + =head1 2.025001 =head2 General Changes diff --git a/Netdisco/share/config.yml b/Netdisco/share/config.yml index 81c6dd07..18fc4f94 100644 --- a/Netdisco/share/config.yml +++ b/Netdisco/share/config.yml @@ -174,7 +174,7 @@ dns: hosts_file: '/etc/hosts' no: ['fe80::/64','169.254.0.0/16'] -#housekeeping: +#schedule: # discoverall: # when: '5 7 * * *' # macwalk: diff --git a/Netdisco/share/environments/deployment.yml b/Netdisco/share/environments/deployment.yml index 14d5d763..fc7f795d 100644 --- a/Netdisco/share/environments/deployment.yml +++ b/Netdisco/share/environments/deployment.yml @@ -42,7 +42,7 @@ snmp_auth: # daemon will keep netdisco up to date on this schedule # ````````````````````````````````````````````````````` -#housekeeping: +#schedule: # discoverall: # when: '5 7 * * *' # macwalk: