Forum Discussion

Mitch_Chen_5975's avatar
Mitch_Chen_5975
Historic F5 Account
Aug 06, 2008

How to trigger GTM iRule

This is a GTM iRULE v9.4.3

 

 

I am trying to trigger GTM iRule after GTM load balanced decision had occoured with iRule below. But for it is not returning any A record answer from my eastcoast_test_pool.

 

 

The Wideip is configured with a Pool using RTT to select one of the GTM pool member. Base on the pool member subnet address, and I want anser A record from east or west_test pool.

 

 

Am I using the wrong event for GTM?

 

 

when LB_SELECTED {

 

if { [IP::addr [LB::server addr]/24 equals "69.63.184.0"] } {

 

pool "eastcoast_test_pool"

 

} else {

 

pool "westcoast_test_pool"

 

}

 

}

4 Replies

  • To check if it is triggered you can insert some logging into your iRule, it should show you if you face a problem with the pool command or the event (if no logging appear at all).

     

     

    If this is the pool command, do you see any weird messages in /var/log/ltm when the iRule is triggered?

     

     

  • Mitch_Chen_5975's avatar
    Mitch_Chen_5975
    Historic F5 Account
    I did some more testing and found out LB_selected event works. Pool command does not work in GTM irule.

     

     

    I switch from pool command to cname commands and the iRule works.

     

    What is the expected behavior for pool GTM iRule command? Should it re-load balance again after LB_selected?

     

     

    when LB_SELECTED {

     

    if { [IP::addr [LB::server addr]/24 equals "10.10.10.0"] } {

     

    pool eastcoast_test_pool

     

    } else {

     

    pool westcoast_test_pool

     

    }

     

    }

     

  • it worked Oo ?

     

     

    i removed this part of my message since i saw you were looking for the server IP address. Doesn't really make sense you can have the Server ip address here Oo