Forum Discussion
Kdedesko_49781
Nimbostratus
Mar 04, 2015Can anyone see anything wrong with these I-Rules?
Hi
I am new to writing I-Rules and have put an I-Rule together that is quite simple and I think will work but am wondering if there is something obviously wrong with them before I implement them. ...
Michael_Jenkins
Cirrostratus
Mar 04, 2015Did you get a chance to check out the active_members wiki page, the LB::server pool command and the iRules 101 page on pools and members and such? They have some more specific details on this.
I think your iRule may need a little tweak to get the pool name when checking for active members. You can either use
[active_members POOL_NAME] to specify a pool name. Otherwise you could use [active_members [LB::server pool]] instead to get whatever the currently set pool is. (And I'd include the "Connection Close" header on the return as well)
rule TEST {
when HTTP_REQUEST {
if { [active_members POOL_NAME] > 0 } {
HTTP::respond 200 content "" Connection Close
} else {
HTTP::respond 404 content "" Connection Close
}
}
}
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