Forum Discussion

Brian_Gibson_30's avatar
Brian_Gibson_30
Icon for Nimbostratus rankNimbostratus
May 15, 2014

Receive string not matching on request

I am fairly new to doing HTTP requests. My company doesn't do a lot of http specific stuff on the LBs.

Anyway I'm trying to do a basic http monitor and I can't seem to get the receive to match. Here is the info.

monitor Blah {
   defaults from http
   recv "HTTP/1.1 200 OK"
   send "GET /BCCommunicationDirector/Blah.ashx\r\n"
}
monitor BlahSSL {
   defaults from https
   send "GET https://BCCommunicationDirector/Blah.ashx /\r\n"
}
monitor quick_tcp_half_open {
   defaults from tcp

Here is the curl

  • About to connect() to 10.1.114.96 port 80
  • Trying 10.1.114.96... connected
  • Connected to 10.1.114.96 (10.1.114.96) port 80

GET //BCCommunicationDirector/Blah.ashx HTTP/1.1 User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 Host: 10.1.114.96 Accept: /

< HTTP/1.1 200 OK < Cache-Control: private < Content-Type: text/html; charset=utf-8 < Server: Microsoft-IIS/7.5 < X-AspNet-Version: 4.0.30319 < X-Powered-By: ASP.NET < Date: Thu, 15 May 2014 18:20:48 GMT < Content-Length: 242 Blah SS HTTP GET 2668 -- from 10.129.155.202 10.129.155.202 10.129.155.202 * Connection 0 to host 10.1.114.96 left intact * Closing connection 0

doing a debut gives me this..

2014-05-15 14:26:06.162572: ID 153 :(_recv_active_service_ping): Response did not match recv regex yet [ addr=::ffff:10.1.114.97:80 srcaddr=::ffff:10.129.155.202:54744 ] 2014-05-15 14:26:06.164367: ID 153 :(_main_loop): rfd selected [ addr=::ffff:10.1.114.97:80 srcaddr=::ffff:10.129.155.202:54744 fd=10 pend=0 conn=0 ] 2014-05-15 14:26:06.164600: ID 153 :(_recv_active_service_ping): reading [ addr=::ffff:10.1.114.97:80 srcaddr=::ffff:10.129.155.202:54744 ] 2014-05-15 14:26:06.164855: ID 153 :(_recv_active_service_ping): read failed [ addr=::ffff:10.1.114.97:80 srcaddr=::ffff:10.129.155.202:54744 ] 2014-05-15 14:26:06.165088: ID 153 :(_recv_active_service_ping): Response did not match recv regex yet [ addr=::ffff:10.1.114.97:80 srcaddr=::ffff:10.129.155.202:54744 ] 2014-05-15 14:26:06.165358: ID 153 :(_recv_active_service_ping): Hit EOF [ addr=::ffff:10.1.114.97:80 srcaddr=::ffff:10.129.155.202:54744 ]

So am I doing something wrong with the request because I can't understand why the receive string isn't matching. I literally copied it from the curl output.

7 Replies

  • Change your monitor Blah send string to this (replace host.domain.com with the actual host name):

    GET /BCCommunicationDirector/Blah.ashx HTTP/1.1\r\nHost: host.domain.com\r\nConnection: Close\r\n\r\n

    You need to specify a host header in your send string to comply with HTTP/1.1.

    • Brian_Gibson_30's avatar
      Brian_Gibson_30
      Icon for Nimbostratus rankNimbostratus
      Thanks Cory. I don't have an actual host name to for this specific service. Is there a way to use the node IP address in the check?
    • Cory_50405's avatar
      Cory_50405
      Icon for Noctilucent rankNoctilucent
      That should also work. In your cURL statement above, you can see the HTTP/1.1 request specifying the IP address as the host, and the server responded with a 200 OK. Looks like it isn't doing any host name checking.