Forum Discussion
Using iRule to redirect F5 traffic
requests are being made for "; but you want to check the page ";, so [HTTP::host] will not cover what you want to check for. That is ONLY checking the host portion of the URL, and from your question you don't want to check that either, you want to check the content of the page ";
1- set a health check for your pool members to do a GET and look for "Offline" in the page.
2- use an iRule to determine the health of a pool and then re direct otherwise:
when CLIENT_ACCEPTED { set DEFAULT_POOL [LB::server pool] }
when HTTP_REQUEST {
if {[active_members $DEFAULT_POOL] == 0} {
HTTP::respond 301 Location "http://www.google.com"
} else {
pool $DEFAULT_POOL
}
}
the layer 7 health check will determine if content is available on a page or if the server is available at all. Your health checks for your pool can be completely different than what they members deliver to the users.
for your http health check send this- http://abc.home.com/home/a/b/Offline.html
leave the return string blank(any response passes) or look for a string that exists on the page like "Offline". For troubleshooting purposes I would just leave it blank
Then the f5 will monitor the members. For each connection to the VS the iRule will check if the number of available servers. If it is 0, then a redirect is send back to the client. If at least one pool member is available, it will balance to the default pool.
If you want to test create a test pool with the same members and a test VIP with the iRule.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com