Forum Discussion
Colin_Walker_12
Apr 09, 2008Historic F5 Account
Since there isn't currently a command to view the number of active sessions, or to tell if a request coming in is from a currently active session, the best way to go about this would be to tag all incoming requests somehow (a cookie perhaps?) after you've checked to see if there are any active members.
That would look something like this:
when HTTP_REQUEST {
if { [HTTP::cookie exists MYCOOKIE] } {
pool MYPOOL
} else {
if { [active_members MYPOOL] == 0 } {
HTTP::redirect "http://www.google.com"
} else {
HTTP::cookie insert MYCOOKIE ...
pool MYPOOL
}
}
}
Effectively what that says is:
If the custom cookie exists, send to pool regardless of pool status.
If the custom cookie does not exist, check the pool status. If there are no members available, redirect to google. If there are, set the cookie and send them to the pool.
Is that what you're trying to accomplish?
Also - can I ask why you'd want to allow active sessions to try and connect when there are no servers available?
HTH,
Colin