From 021947ad8e963d89bdb00bd9de24dc962a3472bf Mon Sep 17 00:00:00 2001 From: Niko Tyni Date: Thu, 10 Mar 2005 11:00:44 +0000 Subject: * 2.0/lib/Smokeping/probes/Curl.pm, 2.0/doc/smokeping_upgrade.pod, 2.0/CHANGES: + new variables: extraargs and extrare --- lib/Smokeping/probes/Curl.pm | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'lib/Smokeping/probes/Curl.pm') diff --git a/lib/Smokeping/probes/Curl.pm b/lib/Smokeping/probes/Curl.pm index 56dd338..e00c749 100644 --- a/lib/Smokeping/probes/Curl.pm +++ b/lib/Smokeping/probes/Curl.pm @@ -102,6 +102,38 @@ host to be probed. DOC _example => "http://%host%/", }, + extrare=> { + _doc => < "/ /", + _example => "/ /", + _sub => sub { + my $val = shift; + return "extrare should be specified in the /regexp/ notation" + unless $val =~ m,^/.*/$,; + return undef; + }, + }, + extraargs => { + _doc => <. +DOC + _example => "-6 --head --user user:password", + }, }); } @@ -181,6 +213,16 @@ sub proto_args { return(@args); } +sub extra_args { + my $self = shift; + my $target = shift; + my $args = $target->{vars}{extraargs}; + return () unless defined $args; + my $re = $target->{vars}{extrare}; + ($re =~ m,^/(.*)/$,) and $re = qr{$1}; + return split($re, $args); +} + sub make_commandline { my $self = shift; my $target = shift; @@ -191,6 +233,7 @@ sub make_commandline { my $host = $target->{addr}; $url =~ s/%host%/$host/g; push @args, $self->proto_args($target); + push @args, $self->extra_args($target); return ($self->{properties}{binary}, @args, $url); } -- cgit v1.2.3-24-g4f1b