Forum Discussion
lucaspawpaw_559
Nimbostratus
Jul 28, 2011Balance to webserver port based on value held in status file
Hi all,
First time poster, and recently getting into load balancing. I'm perfectly fine with setting up virtual servers to do the basic tasks, but I'm getting stuck on iRules. Is th...
The_Bhattman
Nimbostratus
Jul 29, 2011Hi lucaspawpaw,
iRule cannot directly read the value of a text file. However, you can read a value for your sorry page indirectly.
For example (let's assume you have 3 values)
1. You can create a ping page http://www.domain.com/ping.html. Contained in the ping.html page will hold a value.
2. You then create 3 F5 monitors associated to 3 new "dummy" pools. These pools will contain node members that will host the ping.html file
3. You then create an iRule similar to the one below
when CLIENT_ACCEPTED {
if { [active_members pool1] = 0 } {
pool pool7007
return
} else if {[active_member pool2] = 0 {
HTTP::respond 404 content "SORRY PAGEWe apologies, the website you are trying to reach is current experiencing technical difficulties"
return
}
}
The way it works is that monitor fails then the irule will catch the failure as a 0 available members in a specific pool which would then be triggered to "Do something" based on those condition
I hope this helps
Bhattman
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects