Forum Discussion

abachman_72712's avatar
abachman_72712
Icon for Nimbostratus rankNimbostratus
Aug 12, 2009

Setting up Debugging

I would like to incorporate debugging into my following iRule, which I have setup to for the following HTTP_REQUEST to direct traffic by incoming IP address. Traffic being generated is being sent back through the LTM to originator, but if originating member is not available then sends to other member of pool. Traffic that does not match IP will go straight to other pool member.

 

 

when CLIENT_ACCEPTED {

 

set lb_retried 0

 

}

 

when HTTP_REQUEST {

 

if { [IP::addr [IP::client_addr] equals 10.10.10.10] } {

 

pool soap_pool member 10.10.10.10 9081

 

} else {

 

pool soap_pool member 10.10.10.11 9081

 

}

 

}

 

when LB_FAILED {

 

if {$lb_retried eq 0} {

 

set lb_retried 1;

 

if { [IP::addr [IP::client_addr] equals 10.10.10.10] } {

 

pool soap_pool member 10.10.10.10.11 9081

 

} else {

 

pool soap_pool member 10.10.10.11 9081

 

}

 

} else {

 

log error?

 

}

 

}
  • You can use the command

     

     

    log local0. "The client [IP::client_addr] didn't make the grade"

     

     

    However, looking at your code, I think there might be simpler way to detect the LB failure.

     

     

    What if you change it to

     

     
     when LB_FAILED {  
          pool soap_pool 
          LB::reselect 
        } 
     

     

     

    This assumes that the pool has a health check, monitoring each node within the pool. Therefore, it would reselect the the healthiest member in the pool.

     

     

    I hope that helps

     

     

    CB