Forum Discussion
using iRule for health monitor type information for decisions
I would setup a duplicate pool with a duplicate HTTP monitor only looking for the response systemstatus=true then use an iRule or Policy to identify testing and set the pool to be the duplicate test pool.
This way normal users still hit the default pool and get redirected if all members are down while testers hit another pool.
I think this is best open as monitors are boolean, either up or down and do not hold any custom logic/data that you can use in an iRule.
Here is a simple example iRule for the solution but you should also do this in a Policy. You will need to create a Datagroup of type IP listing the IP hosts and/or subnets of testers or update the code to identify testers in some other way.
when HTTP_REQUEST {
Get default pool, as configured on virtual server
set selectedPool [LB::server pool]
Get client IP address (removing % if Route Domains are in use) and check against Data Group 'testersDG'
if {[class match [getfield [IP::client_addr] "%" 1] eq "testersDG"]} {
Request is from a test user, using testerPool
selectedPool testerPool
}
if {active_members $selectedPool < 1} {
HTTP::redirect https://someApp.com/sorrypage.html
}
}
Recent Discussions
Related Content
* 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