Forum Discussion

Machado_74574's avatar
Machado_74574
Icon for Nimbostratus rankNimbostratus
Aug 22, 2012

Manual Trigger

Hi All,

 

 

I am looking for your help with an iRule that I just made. My desire is to create an iRule where I can have a variable set as a manual trigger where I can manually change the value of it to change the behavior of my flow.

 

 

Here is the code I made:

 

Basically, if I set the variable "indisponibilidade" as "0" it will direct the connection to pools in "vmpwin002", if I set the variable with the value "1", it will direct the connection to pools in "app_sites".

 

 

I´ll appreciate your help to validate this code as I am quite new in F5 scripiting, so I am not sure if my code is right.

 

 

when DNS_REQUEST {

 

set indisponibilidade 0

 

 

if { [$indisponibilidade == 0] } {

 

if { [matchregion ldns region_int] } {

 

pool pool_vmpwin002_int

 

}

 

else {

 

pool pool_vmpwin002_ext

 

}

 

 

if { [matchregion ldns region_internal] } {

 

pool pool_prod_app_sites_int

 

}

 

else {

 

pool pool_prod_app_sites_ext

 

}

 

}

 

}

 

 

Thanks in advance!

 

Rafael Machado
  • i think using static global variable might be better than local one since it does not need to create and delete for every connection.

     

     

    static wiki

     

    https://devcentral.f5.com/wiki/iRules.static.ashx