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...
nitass
Employee
Aug 01, 2013The problem I have now is how to confirm that all nodes in a pool are in a disabled status. The following code is close but I do not have a way to test the total response from a pool. can you try something like this?
e.g.
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.252:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b pool foo list
pool foo {
members {
200.200.200.101:80 {
session user disabled
}
200.200.200.111:80 {
session user disabled
}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
set is_disabled 1
foreach poolmbr [members -list [LB::server pool]] {
if { [eval "LB::status pool foo member $poolmbr"] ne "session_disabled" } {
set is_disabled 0
break
}
}
if { $is_disabled } {
HTTP::respond 302 noserver Location "http://www.google.com/"
}
}
}
test
[root@ve10:Active] config b pool foo|grep -i pool\ member
+-> POOL MEMBER foo/200.200.200.101:80 active,unchecked
+-> POOL MEMBER foo/200.200.200.111:80 active,unchecked
[root@ve10:Active] config curl -i http://172.28.19.252
HTTP/1.0 302 Found
Location: http://www.google.com/
Connection: Keep-Alive
Content-Length: 0
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