diff options
author | Niko Tyni <ntyni@iki.fi> | 2007-04-14 20:11:44 +0200 |
---|---|---|
committer | Niko Tyni <ntyni@iki.fi> | 2007-04-14 20:11:44 +0200 |
commit | 71ced95ec446391172c5f84be3950498a2a0a728 (patch) | |
tree | edac151c28e9e30ef0de7d252cbb3ae588ef8ec4 /lib/Smokeping | |
parent | ee78a2434ef77fdce97546aca173ebbd0391676a (diff) | |
download | smokeping-71ced95ec446391172c5f84be3950498a2a0a728.tar.gz smokeping-71ced95ec446391172c5f84be3950498a2a0a728.tar.xz |
r1042@rispa: niko | 2007-04-14 08:24:57 +0300
post args
Diffstat (limited to 'lib/Smokeping')
-rw-r--r-- | lib/Smokeping/probes/EchoPing.pm | 6 | ||||
-rw-r--r-- | lib/Smokeping/probes/EchoPingPlugin.pm | 24 |
2 files changed, 28 insertions, 2 deletions
diff --git a/lib/Smokeping/probes/EchoPing.pm b/lib/Smokeping/probes/EchoPing.pm index 94f31ac..65bac3e 100644 --- a/lib/Smokeping/probes/EchoPing.pm +++ b/lib/Smokeping/probes/EchoPing.pm @@ -112,6 +112,9 @@ sub make_host { return $target->{addr}; } +sub make_post_args { + return (); +} # other than host, count and protocol-specific args come from here sub make_args { @@ -178,11 +181,12 @@ sub make_commandline { $count |= $self->pings($target); my @args = $self->make_args($target); + my @post_args = $self->make_post_args($target); my $host = $self->make_host($target); push @args, $self->proto_args($target); push @args, $self->count_args($count); - return ($self->{properties}{binary}, @args, $host); + return ($self->{properties}{binary}, @args, $host, @post_args); } sub pingone { diff --git a/lib/Smokeping/probes/EchoPingPlugin.pm b/lib/Smokeping/probes/EchoPingPlugin.pm index 36ca359..69c8596 100644 --- a/lib/Smokeping/probes/EchoPingPlugin.pm +++ b/lib/Smokeping/probes/EchoPingPlugin.pm @@ -29,6 +29,8 @@ Niko Tyni <ntyni@iki.fi> DOC notes => <<'DOC', The I<fill>, I<size> and I<udp> EchoPing variables are not valid by default for EchoPingPlugin -derived probes. + +Plugins are available starting with echoping version 6. DOC see_also => <<DOC, L<Smokeping::probes::EchoPing> @@ -49,6 +51,11 @@ sub _init { delete $arghashref->{udp}; } +sub post_args { + my $self = shift; + my $target = shift; + return $target->{vars}{pluginargs}; +} sub proto_args { my $self = shift; @@ -79,7 +86,22 @@ sub targetvars { delete $h->{fill}; delete $h->{size}; return $class->_makevars($h, { - }); + pluginname => { + _doc => <<DOC, +The name of the echoping plugin that will be used. See echoping(1) +for details. +DOC + _example => "random", + }, + pluginargs => { + _doc => <<DOC, +Any extra arguments needed by the echoping plugin specified with the +I<pluginname> variable. These are generally provided by the subclass probe. +DOC + _example => "-p plugin_specific_arg", + }, + }, + ); } 1; |