diff options
author | Tobi Oetiker <tobi@oetiker.ch> | 2007-05-28 17:23:51 +0200 |
---|---|---|
committer | Tobi Oetiker <tobi@oetiker.ch> | 2007-05-28 17:23:51 +0200 |
commit | 72804714f5a4a15706215c0ea3f0b4a288b3428f (patch) | |
tree | f3f5308e67ce21bd8e1f0362415d3929a0122f9e /lib/Smokeping/probes | |
parent | d13567a129969c4c3ca0548d08a0d34473aca66d (diff) | |
download | smokeping-72804714f5a4a15706215c0ea3f0b4a288b3428f.tar.gz smokeping-72804714f5a4a15706215c0ea3f0b4a288b3428f.tar.xz |
do not test echoping and curl functionality with 127.0.0.1 since there may be someone behind this address
Diffstat (limited to 'lib/Smokeping/probes')
-rw-r--r-- | lib/Smokeping/probes/Curl.pm | 5 | ||||
-rw-r--r-- | lib/Smokeping/probes/EchoPing.pm | 2 | ||||
-rw-r--r-- | lib/Smokeping/probes/EchoPingChargen.pm | 2 | ||||
-rw-r--r-- | lib/Smokeping/probes/EchoPingDiscard.pm | 2 | ||||
-rw-r--r-- | lib/Smokeping/probes/EchoPingHttp.pm | 6 | ||||
-rw-r--r-- | lib/Smokeping/probes/EchoPingHttps.pm | 2 | ||||
-rw-r--r-- | lib/Smokeping/probes/EchoPingIcp.pm | 2 | ||||
-rw-r--r-- | lib/Smokeping/probes/EchoPingPlugin.pm | 2 | ||||
-rw-r--r-- | lib/Smokeping/probes/EchoPingSmtp.pm | 2 |
9 files changed, 13 insertions, 12 deletions
diff --git a/lib/Smokeping/probes/Curl.pm b/lib/Smokeping/probes/Curl.pm index 5f237ab..ee8541b 100644 --- a/lib/Smokeping/probes/Curl.pm +++ b/lib/Smokeping/probes/Curl.pm @@ -204,13 +204,14 @@ sub test_usage { my %arghash = %$arghashref; for my $feature (keys %arghash) { - if (`$bin $arghash{$feature} 1 127.0.0.1 2>&1` =~ /invalid option|usage/i) { + system("$bin $arghash{$feature} 1 0.0.0.1 >/dev/null 2>&1"); + if ($? == 2) { push @unsupported, $feature; $self->do_log("Note: your curl doesn't support the $feature feature (option $arghash{$feature}), disabling it"); } } map { delete $arghashref->{$_} } @unsupported; - if (`$bin -o /dev/null -w '<%{time_redirect}>\n' 127.0.0.1 2>&1` =~ /^<>/m) { + if (`$bin -o /dev/null -w '<%{time_redirect}>\n' 0.0.0.1 2>&1` =~ /^<>/m) { $self->do_log("Note: your curl doesn't support the 'time_redirect' output variable; 'include_redirects' will not function."); } return; diff --git a/lib/Smokeping/probes/EchoPing.pm b/lib/Smokeping/probes/EchoPing.pm index 2bf8a3e..4be5a0d 100644 --- a/lib/Smokeping/probes/EchoPing.pm +++ b/lib/Smokeping/probes/EchoPing.pm @@ -90,7 +90,7 @@ sub test_usage { my %arghash = %$arghashref; for my $feature (keys %arghash) { - if (`$bin $arghash{$feature} 1 127.0.0.1 2>&1` =~ /invalid option|usage/i) { + if (`$bin $arghash{$feature} 1 0.0.0.1 2>&1` =~ /invalid option|usage/i) { push @unsupported, $feature; $self->do_log("Note: your echoping doesn't support the $feature feature (option $arghash{$feature}), disabling it"); } diff --git a/lib/Smokeping/probes/EchoPingChargen.pm b/lib/Smokeping/probes/EchoPingChargen.pm index 5570b67..53f4386 100644 --- a/lib/Smokeping/probes/EchoPingChargen.pm +++ b/lib/Smokeping/probes/EchoPingChargen.pm @@ -46,7 +46,7 @@ sub test_usage { my $self = shift; my $bin = $self->{properties}{binary}; croak("Your echoping binary doesn't support CHARGEN") - if `$bin -c 2>&1 127.0.0.1` =~ /(usage|not compiled|invalid option)/i; + if `$bin -c 2>&1 0.0.0.1` =~ /(usage|not compiled|invalid option)/i; $self->SUPER::test_usage; return; } diff --git a/lib/Smokeping/probes/EchoPingDiscard.pm b/lib/Smokeping/probes/EchoPingDiscard.pm index 33933b6..2970232 100644 --- a/lib/Smokeping/probes/EchoPingDiscard.pm +++ b/lib/Smokeping/probes/EchoPingDiscard.pm @@ -46,7 +46,7 @@ sub test_usage { my $self = shift; my $bin = $self->{properties}{binary}; croak("Your echoping binary doesn't support DISCARD") - if `$bin -d 127.0.0.1 2>&1` =~ /(not compiled|invalid option|usage)/i; + if `$bin -d 0.0.0.1 2>&1` =~ /(not compiled|invalid option|usage)/i; $self->SUPER::test_usage; return; } diff --git a/lib/Smokeping/probes/EchoPingHttp.pm b/lib/Smokeping/probes/EchoPingHttp.pm index beb7d4b..7107de6 100644 --- a/lib/Smokeping/probes/EchoPingHttp.pm +++ b/lib/Smokeping/probes/EchoPingHttp.pm @@ -88,13 +88,13 @@ sub test_usage { my $self = shift; my $bin = $self->{properties}{binary}; croak("Your echoping binary doesn't support HTTP") - if `$bin -h / 127.0.0.1 2>&1` =~ /(invalid option|not compiled|usage)/i; - if (`$bin -a -h / 127.0.0.1 2>&1` =~ /(invalid option|not compiled|usage)/i) { + if `$bin -h / 0.0.0.1 2>&1` =~ /(invalid option|not compiled|usage)/i; + if (`$bin -a -h / 0.0.0.1 2>&1` =~ /(invalid option|not compiled|usage)/i) { carp("Note: your echoping binary doesn't support revalidating (-a), disabling it"); $self->{_disabled}{a} = undef; } - if (`$bin -A -h / 127.0.0.1 2>&1` =~ /(invalid option|not compiled|usage)/i) { + if (`$bin -A -h / 0.0.0.1 2>&1` =~ /(invalid option|not compiled|usage)/i) { carp("Note: your echoping binary doesn't support ignoring cache (-A), disabling it"); $self->{_disabled}{A} = undef; } diff --git a/lib/Smokeping/probes/EchoPingHttps.pm b/lib/Smokeping/probes/EchoPingHttps.pm index 8800592..941df32 100644 --- a/lib/Smokeping/probes/EchoPingHttps.pm +++ b/lib/Smokeping/probes/EchoPingHttps.pm @@ -54,7 +54,7 @@ sub test_usage { my $self = shift; my $bin = $self->{properties}{binary}; - my $response = `$bin -C -h / 127.0.0.1 2>&1`; + my $response = `$bin -C -h / 0.0.0.1 2>&1`; croak("Your echoping binary doesn't support SSL") if ($response =~ /(not compiled|invalid option|usage)/i); $self->SUPER::test_usage; diff --git a/lib/Smokeping/probes/EchoPingIcp.pm b/lib/Smokeping/probes/EchoPingIcp.pm index 7392e60..17a1c50 100644 --- a/lib/Smokeping/probes/EchoPingIcp.pm +++ b/lib/Smokeping/probes/EchoPingIcp.pm @@ -61,7 +61,7 @@ sub test_usage { my $self = shift; my $bin = $self->{properties}{binary}; croak("Your echoping binary doesn't support ICP") - if `$bin -t1 -i/ 127.0.0.1 2>&1` =~ /not compiled|usage/i; + if `$bin -t1 -i/ 0.0.0.1 2>&1` =~ /not compiled|usage/i; $self->SUPER::test_usage; return; } diff --git a/lib/Smokeping/probes/EchoPingPlugin.pm b/lib/Smokeping/probes/EchoPingPlugin.pm index 79d2c0c..0762f45 100644 --- a/lib/Smokeping/probes/EchoPingPlugin.pm +++ b/lib/Smokeping/probes/EchoPingPlugin.pm @@ -79,7 +79,7 @@ sub test_usage { my $bin = $self->{properties}{binary}; # is there anything smarter to do? croak("Your echoping binary doesn't support plugins. At least version 6 is required.") - if `$bin -m improbable_plugin_name 127.0.0.1 2>&1` =~ /invalid option/i; + if `$bin -m improbable_plugin_name 0.0.0.1 2>&1` =~ /invalid option/i; $self->SUPER::test_usage; return; } diff --git a/lib/Smokeping/probes/EchoPingSmtp.pm b/lib/Smokeping/probes/EchoPingSmtp.pm index 8175fea..a65b97c 100644 --- a/lib/Smokeping/probes/EchoPingSmtp.pm +++ b/lib/Smokeping/probes/EchoPingSmtp.pm @@ -54,7 +54,7 @@ sub test_usage { my $self = shift; my $bin = $self->{properties}{binary}; croak("Your echoping binary doesn't support SMTP") - if `$bin -S 127.0.0.1 2>&1` =~ /(not compiled|invalid option|usage)/i; + if `$bin -S 0.0.0.1 2>&1` =~ /(not compiled|invalid option|usage)/i; $self->SUPER::test_usage; return; } |