cancel
Showing results for 
Search instead for 
Did you mean: 
svoll
Nimbostratus
Nimbostratus

Problem this snippet solves:

When testing new web apps the developers want to put in iRule that will only allow testers into the server cluster. I wanted a way to allow them to do it without giving them access to the F5.

How to use this snippet:

We have a health monitor that looks for "SystemStatus=OK" that marks the pool up (pool DMZ). We created a second Health Monitor that looks for "SystemStatus=Test". Created a New pool (DMZ_Test) that has the same servers but the new pool name. So based on system status we have three possibilities. OK, Test, or down.

So based on Health monitor, only one pool can ever be up an any given time or both down.

IP address is our AWS work space for testing externally.

No pool is needed on this VS since the iRule does all of the pool assignments.

Hope this helps someone else.

Code :

when HTTP_REQUEST {
if { [active_members dmz] >= 1 } {
pool dmz }  
elseif { [active_members dmz] equals 0 and [active_members dmz_test] equals 0 }{
HTTP::redirect "https:///downpage/"} 
elseif { [IP::addr [IP::client_addr] equals ] and [active_members dmz_test] > 0 }{
 pool dmz_test}
else
{HTTP::redirect "https:///maintenancepage/"}

}

Tested this on version:

13.0
Version history
Last update:
‎12-Feb-2019 06:55
Updated by:
Contributors