diff options
author | Niko Tyni <ntyni@iki.fi> | 2007-12-13 12:48:09 +0100 |
---|---|---|
committer | Niko Tyni <ntyni@iki.fi> | 2007-12-13 12:48:09 +0100 |
commit | f3e27df9021d2ba92b54cb9e8a82c66336a477e8 (patch) | |
tree | 7328794d9ab51ee611e6a8ca9687c785bc07d009 /lib/Smokeping | |
parent | 7362792c380114c774fd01120c978360e81360d3 (diff) | |
download | smokeping-f3e27df9021d2ba92b54cb9e8a82c66336a477e8.tar.gz smokeping-f3e27df9021d2ba92b54cb9e8a82c66336a477e8.tar.xz |
EchoPingHttp: add the 'accept_redirects' option
Diffstat (limited to 'lib/Smokeping')
-rw-r--r-- | lib/Smokeping/probes/EchoPingHttp.pm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Smokeping/probes/EchoPingHttp.pm b/lib/Smokeping/probes/EchoPingHttp.pm index 1281a39..3cbbb71 100644 --- a/lib/Smokeping/probes/EchoPingHttp.pm +++ b/lib/Smokeping/probes/EchoPingHttp.pm @@ -81,6 +81,13 @@ sub proto_args { and $revalidate ne "0"); push @args, "-a" if $revalidate and not exists $self->{_disabled}{a}; + # -R : accept HTTP redirects + my $accept_redirects = $target->{vars}{accept_redirects}; + $accept_redirects= 1 if (defined $accept_redirects + and $accept_redirects ne "no" + and $accept_redirects ne "0"); + push @args, "-R" if $accept_redirects; + return @args; } @@ -123,6 +130,16 @@ server. Enabled if the value is anything other than 'no' or '0'. DOC _example => 'no', }, + accept_redirects => { + _doc => <<DOC, +The echoping(1) "-R" option: Accept HTTP status codes 3xx (redirections) +as normal responses instead of treating them as errors. Note that this option +is only available starting with Echoping 6. + +Enabled if the value is anything other than 'no' or '0'. +DOC + _example => 'yes', + }, }); } |