OSDN Git Service

ticket #441 対処
authortsukahara <tsukahara@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Mon, 18 Jan 2010 08:11:32 +0000 (08:11 +0000)
committertsukahara <tsukahara@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Mon, 18 Jan 2010 08:11:32 +0000 (08:11 +0000)
git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-ramiel@9757 1ed66053-1c2d-0410-8867-f7571e6e31d3

l7directord/l7directord

index b49fe12..2f187ac 100644 (file)
@@ -2390,13 +2390,20 @@ sub check_http {
         if ( $v->{service} eq 'https'){
             $https_option = '--no-check-certificate';
         }
-        my $command = "/usr/bin/wget " . "-t 1 --timeout $v->{negotiatetimeout} $https_option ".  $r->{url} . ' > /dev/null 2>&1';
-        if( system_wrapper( $command )) {
+        my $recstr = $r->{receive};
+        my $command = "/usr/bin/wget " . "-q -t 1 --timeout $v->{negotiatetimeout} $https_option ".  $r->{url} . ' -O - ';
+        my ($result, $output) = command_wrapper( $command );
+        if( $result ) {
             ld_log( _message( 'WRN1103', 'web', $r->{server}{ip}, $port ) ) if (!defined $status || $status eq $SERVICE_UP);
             return $SERVICE_DOWN;
         }
+        elsif (defined $recstr && $output !~ /$recstr/) {
+            ld_log( _message( 'WRN1103', $recstr, $r->{server}{ip}, $port ) ) if (!defined $status || $status eq $SERVICE_UP);
+            ld_debug(2, "check_http: $r->{url} is down\n");
+            return $SERVICE_DOWN;
+        }
+
         $status_line = '200 OK';
-        return $SERVICE_UP ;
 
     }