Forum Discussion

prasadpkulkarni's avatar
prasadpkulkarni
Icon for Nimbostratus rankNimbostratus
Apr 20, 2011

HTTP health monitor using iRule

Hi

 

 

Need help to configure Health Monitor using iRule

 

- We have two web Servers in Active / Standby mode , running three websites on each server (on three seperate IP with IP Bindings) , our requirement is if any one of the website in a Pool goes down , all web sites should be shifted to other Pool.

 

 

Issue with normal HTTP health monitor is that it deosn't detect the health monitor ( ASP page) configured for other website ( It should be because it deosn't find path for the Virtual directory) , so the health monitor marks the site as down even if it is up. Is there any way to make it work with help of iRule or any ?? please refer me to the solution if already provide ( I am new to this group)

 

 

Thanks & regards

14 Replies

  • Hi Prasad,

     

    An iRule cannot do monitoring activities. If you have setup monitors much like Aaron (Aka Hoolio) had stated then perhaps the next step is to log into the LTM at the shell level and run a couple of commands

     

     

    You can use the telnet command to connect to the pool member and test each server IP address with the site URL that you are using as a monitor. For example:

     

     

    telnet

     

     

    Next, at the prompt enter an appropriate HTTP request line and HTTP headers, hitting Enter once after each line. For example:

     

     

    GET /abc.asp HTTP/1.1

     

    Host: abc.com

     

    Connection: close

     

     

     

    GET /123.asp HTTP/1.1

     

    Host: 123.com

     

    Connection: close

     

     

     

    GET /xyz.asp HTTP/1.1

     

    Host: xyz.com

     

    Connection: close

     

     

     

    This should simulate what each monitor should see as it polls the website.

     

     

    I hope this helps

     

    Bhattman
  • Thank you all for your valuable suggestions on my requirement !!

     

     

    Finally I could achieve this with little different approach with the help of F5 supports of course !!

     

     

    I split the pool into active & standby nodes and then I configured iRule to detect active members in the pool with the help of health monitor for individual pool.

     

     

    below is the iRule for this config.

     

     

    VS1->pool1->site1-active

     

    VS2->pool2->site2-active

     

    VS3->pool3->site3-active

     

    pool4->site1-standby

     

    pool5->site2-standby

     

    pool6->site3-standby

     

     

    For irule, there are three irules and should be applied to VS configuration seperately.

     

     

    1) iRule1-->VS1:

     

    when HTTP_REQUEST {

     

    if { ([active_members pool1] < 1) or ([active_members pool2] < 1) or ([active_members pool3] < 1) } {

     

    pool pool4

     

    } else {

     

    pool pool1

     

    }

     

    }

     

     

    2) iRule2->VS2:

     

    when HTTP_REQUEST {

     

    if { ([active_members pool1] < 1) or ([active_members pool2] < 1) or ([active_members pool3] < 1) } {

     

    pool pool5

     

    } else {

     

    pool pool2

     

    }

     

    }

     

     

    3) iRule3->VS3:

     

    when HTTP_REQUEST {

     

    if { ([active_members pool1] < 1) or ([active_members pool2] < 1) or ([active_members pool3] < 1) } {

     

    pool pool6

     

    } else {

     

    pool pool3

     

    }

     

    }

     

     

  • I am trying the opposite here. I have two web servers with 10 websites (using header for all 10 websites) equally load balanced behind F5. If one of the website goes offline i would like traffic for other 9 websites to continue to loadbalance and the traffic directed to the website that is down should go to other pool member without marking the whole server offline. I want my monitors to look at the header requests and load balance. Thanks..
  • Hi OZ,

     

     

    You can specify a host header in the HTTP/S monitor send string:

     

     

    GET /file.html HTTP/1.1\r\nHost: myhost.example.com\r\nConnection: Close\r\n\r\n

     

     

    So you can create a pool and monitor per web site. If you associate a monitor with the pool (not a node) and that pool member gets marked down, it will not affect the same IP:port configured as a member in a different pool.

     

     

    Aaron