From 71ced95ec446391172c5f84be3950498a2a0a728 Mon Sep 17 00:00:00 2001 From: Niko Tyni Date: Sat, 14 Apr 2007 18:11:44 +0000 Subject: r1042@rispa: niko | 2007-04-14 08:24:57 +0300 post args --- lib/Smokeping/probes/EchoPing.pm | 6 +++++- lib/Smokeping/probes/EchoPingPlugin.pm | 24 +++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) (limited to 'lib') 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 DOC notes => <<'DOC', The I, I and I EchoPing variables are not valid by default for EchoPingPlugin -derived probes. + +Plugins are available starting with echoping version 6. DOC see_also => < @@ -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 => < "random", + }, + pluginargs => { + _doc => < variable. These are generally provided by the subclass probe. +DOC + _example => "-p plugin_specific_arg", + }, + }, + ); } 1; -- cgit v1.2.3-24-g4f1b