Having a Watchdog enabled Load Balancer work with SharePoint

By | 2012-08-16

For a project of mine, I wanted to have the Load Balancer check if SharePoint was still working as part of the Load Balance configuration. This is done with a WatchDog on the Load Balancer side. This WatchDog performs a HTTP Request [HEAD] on a URL to check if the HTTP STATUS CODE is [200] (OK).
If the Url the WatchDog uses point to a Page residing within SharePoint and not just a flat file on a IIS folder, we can actually verify of SharePoint (kind of) works.
So I created a [status.aspx] Page, and uploaded this to a SharePoint Document Library.

How to deploy a List and Page?
Step 1: Create List in the RootWeb of the Root SiteCollection of your Web Application

Step 2: Add a page to the new List

Step 2a: Add a WebPart for kicks, just in case users end up opening the page:

Step 3: Setup the Load Balancer Watchdog to poll for the new Page

You now have a Page with Url: $siteCollectionURL/LoadBalancer/Status.aspx that your Watchdog can use to check if SharePoint still “works”. You can even check the HTTPRESPONSE Header: X-SharePointHealthScore to do smart load balancing.

Preview of the [status.aspx] page with an added js based status indicator:
lb-status-watchdog

Javascript for this status information:

Download [status.aspx] Page and PowerShell script

Leave a Reply

Your email address will not be published. Required fields are marked *