Health Check Page

Table of contents
  1. 1. Ruby on Rails/Mongrel 
  2. 2. Tomcat
  3. 3. PHP
  4. 4. HAProxy

This page will explain how to make a health check page where HAProxy is used to check the status for each one of our platforms.

Ruby on Rails/Mongrel 

  1. Copy mongrel_health_check.rb (attached below) into your server or svn
  2. Add  "config_script:  /path/to/file" to /etc/mongrel_cluster/mongrel_cluster.yml
  3. Set  OPT_HEALTH_CHECK_URI to "/mongrel-status"

 

Tomcat

  1. Create a file named health_check.jsp in your application with the following contents.
    <HTML>
     <HEAD>
      <TITLE>Hello World</TITLE>
     </HEAD>
     <BODY>
      <H1>Hello World</H1>
      Today is: <%= new java.util.Date().toString() %>
     </BODY>
    </HTML>
  2. Set OPT_HEALTH_CHECK_URI to "/health_check.jsp"

 

PHP

  1. Create a file named health_check.php in your application with the following contents.
    <?php
    phpinfo():
    ?>
  2. Set  OPT_HEALTH_CHECK_URI to "/health_check.php"

 

HAProxy

  1. If your sit'e permissions allow it, you can simply add 'haproxy-status' to your domain to check the status of HAProxy. 
    ex: http://www.mysite.com/haproxy-status

 

 

Tag page

Files 1

FileSizeDateAttached by 
 mongrel_health_check_handler.rb
Mongrel Health Check
2.35 kB14:04, 31 Jul 2008rshadeActions
You must login to post a comment.