summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiko Tyni <ntyni@iki.fi>2007-12-13 12:48:09 +0100
committerNiko Tyni <ntyni@iki.fi>2007-12-13 12:48:09 +0100
commitf3e27df9021d2ba92b54cb9e8a82c66336a477e8 (patch)
tree7328794d9ab51ee611e6a8ca9687c785bc07d009
parent7362792c380114c774fd01120c978360e81360d3 (diff)
downloadsmokeping-f3e27df9021d2ba92b54cb9e8a82c66336a477e8.tar.gz
smokeping-f3e27df9021d2ba92b54cb9e8a82c66336a477e8.tar.xz
EchoPingHttp: add the 'accept_redirects' option
-rw-r--r--CHANGES2
-rw-r--r--lib/Smokeping/probes/EchoPingHttp.pm17
2 files changed, 19 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 6ea1e16..85a190f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+* EchoPingHttp: add the 'accept_redirects' option, suggested by
+ Kelly Shutt <kelly *websitesource.com> --niko
* remove a leftover 'use HTTP::Request' from Smokeping::Master -- niko
* document the LWP dependency of the Smokeping::Slave module -- niko
* fix restart behaviour of clients in multiprocess mode. now we just send
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',
+ },
});
}