Forum Discussion

Tim_Armstrong_9's avatar
Tim_Armstrong_9
Icon for Nimbostratus rankNimbostratus
Jul 26, 2012

iRule for monitoring back-end server

Hello All,

 

 

Is there any iRule that can monitor the back-end server so if the back-end server is busy or dies, the pool member will be marked down?

 

 

 

So whenever back-end server is busy or dies, no more traffic will be sent to the pool member since it's marked down by the iRule.

 

 

 

So basically the two tasks of the iRule are monitoring the back-end servers and marking the pool member down.

 

 

 

Anybody has this similar experience or can anybody share how to create, a syntax probably?

 

 

 

Thanks.

 

 

 

 

 

3 Replies

  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    Well... Normally you'd use a monitor for this. But if you really really want an iRule to be intelligent enough (Or require the response time of a check NOW rather than the monitor timeout), you could craft the check yourself using a SIDEBAND connection.

     

     

    Or you could trap the LB_FAILED event and reselect a new member and re-issue the request...

     

     

    H
  • monitauress_634's avatar
    monitauress_634
    Historic F5 Account
    Here is a great document on passive monitoring: http://lorimacvittie.sys-con.com/node/1483899/mobile, with an example at the end.

     

     

    Here are a couple of simple iRules to get started:

     

     

    Mark the pool member down if unable to connect to server:

     

    rule server_down {

     

    when LB_FAILED {

     

    LB::down

     

    }

     

    }

     

     

    Mark the pool member down upon a bad response from server:

     

    rule bad_resp {

     

    when HTTP_RESPONSE {

     

    if { [HTTP::status] >= 500 } {

     

    LB::down

     

    }

     

    }