package Smokeping::probes::basevars; =head1 301 Moved Permanently This is a Smokeping probe module. Please use the command C to view the documentation or the command C to generate the POD document. =cut use strict; use Smokeping::probes::base; use base qw(Smokeping::probes::base); my $e = "="; sub pod_hash { return { name => < <, but supports host-specific variables for the probe. DOC description => < <<'DOC', Niko Tyni DOC bugs => < <, L DOC } } sub add($$) { my $self = shift; my $tree = shift; $self->{target_count}++; $self->{targets}{$tree} = shift; $self->{vars}{$tree} = { %{$self->{properties}}, %$tree }; } sub targets { my $self = shift; my $addr = $self->addresses; my @targets; # copy the addrlookup lists to safely pop my %copy; for (@$addr) { @{$copy{$_}} = @{$self->{addrlookup}{$_}} unless exists $copy{$_}; my $tree = pop @{$copy{$_}}; my $vars = $self->{vars}{$tree}; next if defined $vars->{nomasterpoll} and $vars->{nomasterpoll} eq "yes"; push @targets, { addr => $_, vars => $vars, tree => $tree }; } return \@targets; } sub vars { my $self = shift; my $tree = shift; return $self->{vars}{$tree}; } sub ProbeDesc { return "Probe that supports variables and doesn't override the ProbeDesc method"; } return 1;