Forum Discussion
cmautner_16848
Nimbostratus
Apr 09, 2008Quick question concerning active sessions
I'm looking for code which will determine if all servers are disabled AND no active sessions are in place. I know the active_members command is working properly. I'm having trouble finding an active sessions command.
My goal is to have new attempts to connect redirected to a maintenance page, but active sessions remain active until they disconnect. Any help is appreciated!
when HTTP_REQUEST {
if {[active_members MYPOOL] == 0 && ????[active_connections/sessions] == 0} {
HTTP::redirect "http://www.google.com"
}
}
- Colin_Walker_12Historic F5 AccountSince 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.
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 } } }
- cmautner_16848
Nimbostratus
We have a form that can take 30-45 minutes to fill out, so when we bring the site down for maintenance, we want to let the existing connections finish, while new connections are brought to a "sorry we're down" page. - Nicolas_Menant
Employee
when you disable a pool members it maintains by default the active and persisted connections. - cmautner_16848
Nimbostratus
Nmenant! THATS AWESOME!
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