Forum Discussion
Angus_2141
Jul 16, 2013Historic F5 Account
redirect based on monitor status
I would like to have a process where I am able to redirect a user to site down for maintenance page based on status of monitor. My workflow would be using a monitor to check for the content of a fil...
Angus_2141
Jul 17, 2013Historic F5 Account
Here is one way to meet this requirement I guess...
The default pool in this case has four nodes, I create a new pool with one node. I then assign a monitor to this node that checks for a file on the host in question. If the admin of that server modifies that file the monitor fails. At this time all four nodes in the default pool for this VIP are online and working as expected. So,in this scenario the following irule seems to work as I want meaning the server admin changes a file to indicate a desire to put the application into maintenance mode.
when HTTP_REQUEST {
if { [LB::status pool appllication-maintenance-pool member 192.168.5.5 443 ] eq "down" } {
log local0.info "Server marked down, maintenance page enabled"
HTTP::redirect "http://example.com/errors/maintenance.html"
} elseif { [active_members [LB::server pool]] == 0 } {
HTTP::redirect "http://example.com/errors/sitedown.html"
} elseif {[HTTP::uri] equals "/" } {
HTTP::redirect "https://[HTTP::host]/default/logon"
}
}
I was hoping to find a way to test for the results from a particular monitor against a node but so far I have not found that functionality.
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