summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Smokeping.pm7
-rw-r--r--lib/Smokeping/probes/base.pm4
-rw-r--r--lib/Smokeping/probes/basevars.pm5
3 files changed, 10 insertions, 6 deletions
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;
}