Forum Discussion

RobW's avatar
RobW
Icon for Nimbostratus rankNimbostratus
Jan 30, 2008

HTTP Monitor - Java Script

The following monitor was allegedly working fine on a competitors product, but not on the LTM v9.4.3

 

 

 

send "GET /auth/?checkall=true HTTP/1.0\\r\\n\\r\\n"

 

expect "PASS"

 

 

I believe this was never working correctly. If I modify the send string to:

 

 

GET /auth/?checkall=true HTTP/1.0\\r\\n\\r\\nConnection: Close\n\n

 

 

Receive string error:

 

 

 

400 Bad request

 

 

400 Bad request

 

 

 

 

Connection closed by foreign host.

 

 

Once again if I modify the receive string to:

 

 

GET /auth/?checkall=true - This cause a Java Script to run and the following valid receive string is displayed.

 

 

 

Monitor Output

 

 

PASS

 

 

 

If I list 'PASS' or PASS as the receive string the pool marked a being offline.

 

Output from the command line of the LTM.

 

 

[admin@lb2cmgmt:Active] ~ telnet 10.20.62.65 8080

 

Trying 10.20.62.65...

 

Connected to 10.20.62.65.

 

Escape character is '^]'.

 

GET /auth/?checkall=true

 

 

Monitor Output

 

 

PASS

 

 

Connection closed by foreign host.

 

 

What am I overlooking?

 

 

 

6 Replies

  • I don't think you can specify a Connection header in HTTP v1.0. You only need to use one backslash to escape characters. And there should only be one \r\n between lines. The bigd monitoring daemon appends a trailing \r\n to the request, so you only need to put one at the end.

     

     

    How about this:

     

     

    GET /auth/?checkall=true HTTP/1.1\r\nConnection: Close\r\nHost: \r\n

     

     

    If you still get a 40x error from the web server, try putting a Host header value:

     

     

    GET /auth/?checkall=true HTTP/1.1\r\nConnection: Close\r\nHost: test.example.com\r\n

     

     

    Aaron
  • RobW's avatar
    RobW
    Icon for Nimbostratus rankNimbostratus
    Aaron,

     

    I caught some of your other postings concerning monitoring and here's my attemps below

     

     

    [admin@lb2cmgmt:Active] ~ telnet 10.20.62.65 8080

     

    Trying 10.20.62.65...

     

    Connected to 10.20.62.65.

     

    Escape character is '^]'.

     

    GET /auth/?checkall=true HTTP/1.1\r\nConnection: Close\r\nHost: \r\n

     

     

    400 Bad request

     

     

    400 Bad request

     

     

     

     

    Connection closed by foreign host.

     

    [admin@lb2cmgmt:Active] ~ telnet 10.20.62.65 8080

     

    Trying 10.20.62.65...

     

    Connected to 10.20.62.65.

     

    Escape character is '^]'.

     

    GET /auth/?checkall=true HTTP/1.1\r\nConnection: Close\r\nHost: 10.20.62.65\r\n

     

     

    400 Bad request

     

     

    400 Bad request

     

     

     

     

    Connection closed by foreign host.

     

    [admin@lb2cmgmt:Active]

     

     

    If I just run the following the output is correct, but I cannot match on the receive string of "PASS"

     

     

    [admin@lb2cmgmt:Active] ~ telnet 10.20.62.65 8080

     

    Trying 10.20.32.65...

     

    Connected to 10.20.62.65.

     

    Escape character is '^]'.

     

    GET /auth/?checkall=true

     

     

    Monitor Output

     

     

    PASS

     

     

    Connection closed by foreign host.

     

     

    -Rob
  • RobW's avatar
    RobW
    Icon for Nimbostratus rankNimbostratus
    Thank you for the tip on nc. When I execute the command as listed it works fine. When I set it up as a monitor is fails. I can only believe I'm incorrectly formating the receive string field. I've attached a screen shot of the Monitor send string and receive string.

     

     

    [admin@lb2cmgmt:Active] ~ echo -ne "GET /auth/?checkall=true HTTP/1.1\r\nConnection: Close\r\nHost: \r\n\r\n" | nc 10.20.62.65 8080

     

    HTTP/1.1 200 Ok

     

    Date: Thu, 31 Jan 2008 00:20:25 GMT

     

    Server: AKO Monitoring Server/v1.0

     

    Connection: close

     

    SM_CHECK: PASS

     

    Content-Type: text/html

     

     

     

    Monitor Output

     

     

    PASS

     

     

    [admin@lb2cmgmt:Active] ~

     

     

  • That's an odd one. I assume the send string is all on one line and it's just your browser that's wrapping it?

     

     

    Can you check the web server access logs to see what the app is receiving?

     

     

    You can also enable debug on the monitoring daemon, bigd, by running 'b db Bigd.Debug enable'? The debug is logged to /var/log/bigdlog by default. Because the debug output creates a lot of log output, make sure to disable it once you're done testing by running 'b db Bigd.Debug enable'.

     

     

    Aaron
  • RobW's avatar
    RobW
    Icon for Nimbostratus rankNimbostratus
    Aaron,

     

    Thanks for your help, enabling the debug I was able to see that that the health monitor was running against the service port defined for the pool members, which is different from the port that the monitor needs to check. After reviewing the config manual I found I needed to set the alias service port.

     

     

    Thanks,

     

    Rob