diff options
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | lib/Smokeping.pm | 7 | ||||
-rw-r--r-- | lib/Smokeping/probes/base.pm | 4 | ||||
-rw-r--r-- | lib/Smokeping/probes/basevars.pm | 5 |
4 files changed, 14 insertions, 6 deletions
@@ -1,3 +1,6 @@ +* fix local variable override handling in connection with nomasterpoll + --niko + * add protocol level master/slave protocol to control upgrades --tobi * fix ordering of menu entries again --tobi @@ -35,6 +38,7 @@ * add an optional --pid-dir option to specify the pid directory when running as a slave. --niko + * slaves were not polling targets where nomasterpoll was set --tobi 2008/2/25 -- released version 2.3.2 diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index 62021e2..1e90636 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -416,7 +416,7 @@ sub add_targets ($$$$){ if (ref $tree->{$prop} eq 'HASH'){ add_targets $cfg, $probes, $tree->{$prop}, "$name/$prop"; } - if ($prop eq 'host' and ( not $tree->{nomasterpoll} or $tree->{nomasterpoll} eq 'no') and check_filter($cfg,$name) and $tree->{$prop} !~ m|^/| ) { + if ($prop eq 'host' and ( check_filter($cfg,$name) and $tree->{$prop} !~ m|^/| )) { if($tree->{host} =~ /^DYNAMIC/) { $probeobj->add($tree,$name); } else { @@ -2055,8 +2055,8 @@ DOC nomasterpoll=> { _doc => <<DOC, Use this in a master/slave setup where the master must not poll a particular -target. The master will now skip this entry in its polling cycle. and from -search results. Note that if you set the hide property on a non leaf entry +target. The master will now skip this entry in its polling cycle. +Note that if you set the hide property on a non leaf entry all subordinate entries will also disapear in the menu structure. You can still access them via direct link or via an alternate hierarchy. @@ -2066,7 +2066,6 @@ contain any graphs. DOC _re => '(yes|no)', - _re_error => 'Only set this if you want to hide', _default => 'no', }, diff --git a/lib/Smokeping/probes/base.pm b/lib/Smokeping/probes/base.pm index 15cd03e..cdcad66 100644 --- a/lib/Smokeping/probes/base.pm +++ b/lib/Smokeping/probes/base.pm @@ -74,6 +74,8 @@ sub add($$) my $self = shift; my $tree = shift; + $self->{target_count}++; # increment this anyway + return if defined $tree->{nomasterpoll} and $tree->{nomasterpoll} eq "yes"; $self->{targets}{$tree} = shift; } @@ -281,7 +283,7 @@ sub _pings { sub target_count { my $self = shift; - return scalar keys %{$self->{targets}}; + return $self->{target_count}; } sub probevars { diff --git a/lib/Smokeping/probes/basevars.pm b/lib/Smokeping/probes/basevars.pm index 8a1b475..ec40f99 100644 --- a/lib/Smokeping/probes/basevars.pm +++ b/lib/Smokeping/probes/basevars.pm @@ -69,6 +69,7 @@ sub add($$) my $self = shift; my $tree = shift; + $self->{target_count}++; $self->{targets}{$tree} = shift; $self->{vars}{$tree} = { %{$self->{properties}}, %$tree }; } @@ -84,7 +85,9 @@ sub targets { for (@$addr) { @{$copy{$_}} = @{$self->{addrlookup}{$_}} unless exists $copy{$_}; my $tree = pop @{$copy{$_}}; - push @targets, { addr => $_, vars => $self->{vars}{$tree}, tree => $tree }; + my $vars = $self->{vars}{$tree}; + next if defined $vars->{nomasterpoll} and $vars->{nomasterpoll} eq "yes"; + push @targets, { addr => $_, vars => $vars, tree => $tree }; } return \@targets; } |