[smokeping-users] getting rid of 0.0.0.1 tests

Tobias Oetiker tobi at oetiker.ch
Thu Oct 11 22:46:03 CEST 2007


Al,

I guess we should not do actual network testing but rather resort
to other means of figuring out what works ... I created this little
patch for the curl probe ...

maybe something similar could be done for the echoping crowd.

Index: Curl.pm
===================================================================
--- Curl.pm     (revision 838)
+++ Curl.pm     (working copy)
@@ -202,16 +202,14 @@

        my $arghashref = $self->features;
        my %arghash = %$arghashref;
-
+        my $curl_man = `$bin --manual`;
        for my $feature (keys %arghash) {
-               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");
-               }
+               next if $curl_man =~ /\Q$arghash{$feature}/;
+               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' 0.0.0.1 2>&1` =~ /^<>/m) {
+       if ($curl_man !~ /\stime_redirect\s/) {
                $self->do_log("Note: your curl doesn't support the 'time_redirect' output variable; 'include_redirects' will not function.");
        }
        return;

cheers
tobi

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten
http://it.oetiker.ch tobi at oetiker.ch ++41 62 213 9902



More information about the smokeping-users mailing list