jasona_40790
Aug 23, 2012Nimbostratus
iRule that redirects to Sorry Pool when pool is down
When all of the webservers in a pool are down, I want my users to be directed to the "SorryPage" server pool that will display a maintenance/down page. I've been reading through the forums and I think the best way to do this is via iRules due to the persistent profile issue that can occur when using priorities. I've basically copied other iRules from past posts.
So, I would like to include 1 of these 2 iRules to my webserver VIP. I would like to know which is a better iRule. Does one of these rules run faster or perhaps more efficiently that the other? Thanks for your help.
RULE 1:
when CLIENT_ACCEPTED {
Check if the VS default pool has no active members
if {[active_members [LB::server pool]] == 0}{
pool sorry_pool
}
}
RULE 2:
when CLIENT_ACCEPTED {
Save the name of the VS default pool
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
Check if the VS default pool has any active members
if {[active_members $default_pool]}{
pool $default_pool
} else {
pool sorry_pool
}
}