Forum Discussion

wellington_1134's avatar
wellington_1134
Icon for Nimbostratus rankNimbostratus
Jan 27, 2011

HTTP customer health check

I'm want to write a simple HTTP health check (I'm new to this!)

 

 

[root:F5-Active] config curl http://jupiter-uat.dresdnerkleinwort.net/jupiter/healthCheck.jsp

 

!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"

 

html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"

 

head

 

title>Jupiter Health Check

 

/head

 

body

 

h1>Jupiter Health Check<

 

This page is used by the load balancer to determine whether this node is available for active service.

 

 

 

 

 

 

 

So far I 've setup the following:

 

 

Send String

 

 

GET /jupiter-uat.dresdnerkleinwort.net/jupiter/healthCheck.jsp\r\nConnection: Close\r\n\r\n

 

 

Receive String

 

head

 

 

 

Things are working and the server pool is green.

 

 

Q - what could I put in for the Disable Receive string?

 

and is 'head' with HTMLopen/close brackets sufficent for the Receive string

 

 

 

  • Awesome start.

     

     

    Here's the best resource I've seen on constructing monitors:

     

     

    https://support.f5.com/kb/en-us/solutions/public/2000/100/sol2167.html

     

     

    It looks like you've created a special health check page. Out of curiosity, why not check a page the a user might request? Then, perhaps look for a "200 - OK" response? I ask because I've created special health check pages too and gotten bitten because we had DB issues and even though the App needed the DB, my health check didn't.
  • Posted By wellington on 01/27/2011 08:03 AM

     

    Thanks Chris, I'll take a look at the user request

     

    Your best bet is typically a lightweight HTTP page that requires all systems be functioning in order to return a 200 response. Some folks just use /index.html or whatever the home page is, but depending on the page size, that might not be the best. Also, sometimes the home page simply serves static content. If you're simply load balancing to web servers though, static content might be all you care about.
  • I agree 100% Chris, thanks for bringing this up - it's absolutely a best practice in my opinion, and I wish more folks would use this technique. It more than makes up for the up front work you have to put into it. I realize it's not always an option but for environments where it is, it'll make things much more clear when trouble comes knocking.

     

     

    -Matt Cauthorn