22 November 2012

F5 BIG-IP configuring HTTP and HTTPS monitors 101

HTTP monitors verify that a site is not only up but that it is actually functional.  Monitors can be very basic or they can get rather involved.  Because they do more than simply doing a basic check they are classifed as Extended Content Verification (ECV) monitors.  The steps below will show you the basic of how to configure your own HTTP monitors that are tailored to your specific site.

Before you begin configuring a monitor you need to know some things bout the site's behaviour.  You will need an HTTP sniffer tool for this, such as HTTP watch or Firebug or the developer tool in IE and Chrome.  The reason for this is that it will allow you to see that various strings you will use in the monitor.

The two fields that are most commonly used and changed are the Send String and the receiver string.  To really simplify, it is a GET and RESPONSE pair.  If the response form the server matches the response we configure in the monitor the site is marked as up.

For this example We will use the BIG-IP management GUI site.

Send String
The "Send String" sends a GET request to the web server.  To see and example of the get request start up your browser and HTTP sniffer. Start recording and browse to the site's landing page

If we have a look at the request following the redirect we will see the following:

The Request or Sent header contains the following requets line

GET /tmui/login.jsp HTTP/1.1

We will change this string slightly to be used in the monitor

First up we trim down the request to GET /tmui/login.jsp then we add \r\n  The \r is for Line Feed and the \n is for Carriage Return.  so the final send string is:

GET /tmui/login.jsp \r\n

Receive String
If no Receive string is specified any response is deemed successful

If we look at the response body or content we can see the reply content.  We can use some of this to  populate our receive string.  Try and use a unique string form the response.  Keeping in mind that if a failed response is sent form the server it may contain certain strings as well.

We will use the following as the receive string

// Display error modal if necessary

If you apply the monitor to a pool you will now see that the pool and member is indicated as UP.  Another more generic way of configuring monitors is to use the result code as your return string such as

HTTP/1.0 200 OK
HTTP/1.0 302 Found

Or to indicate a failure

HTTP/1.0 404 Not Found

Marking a node as offline or down
There is additional functionality we can use in the monitor.  Both of these will indicate that the node or pool is not functioning.

Setting the Reverse Option to Yes will mark the node as offline if the receive string matches.  As an example you would use the 404 header with reverse

Marking a node as disabled
Another nice feature to have available is the  Receive Disable string.  When this string is received form the node, the node itself is set to a disabled state.  When a node is set to disabled it will have to be manually enabled again

Interval and Time out
F5 recommend to set your interval and time-out ration to 3n+1.  This will mean that 3 request will have to be dropped before it is marked are down.  Depending on your site and the get and receive content you specify you may want to chnage the value but keep the ratio in mind when doing so.

Putting it all together
So when we put it all together it will look as follows:

Understanding the basic of how these work you can start building your own more specific monitors the really check availability of a web application as opposed to just the state of the web server.

No comments:

Post a Comment