If you want to use another set of servers to handle the requests, the ideal solution would be add them to the pool as lower priority members. You can configure the pool so that only the higher priority members are used by default. You can check the LTM configuration guide on AskF5.com for your version for details. The lower priority members are used only if the higher priority are all marked down.
Else, if you want to use a rule, you could use something like this:
when CLIENT_ACCEPTED {
check if the default pool on VIP has no active members
if {[active_members [LB::server pool]] < 1}{
default pool on VIP has no active members
pool fallback_pool
}
}
This rule is triggered when a TCP connection is established with a client. [LB::server pool] returns the name of the default pool configured on the virtual server. [active_members POOL_NAME] returns the number of members in the pool that are not marked down. If there aren't any active members, the fallback_pool is used for the duration of the TCP connection.
Aaron