Forum Discussion
Andy_McGrath
Dec 15, 2017Cumulonimbus
This is not to hard I think, you need to copy your original pool but do not put any monitors on it or put a simple monitor like a TCP or TCP Half Open just to ensure the servers are up.
Then you need an iRule to check default pools active member status:
when CLIENT_ACCEPTED {
Set backup pool name to variable
set backupPool "backup_pool"
if {[active_members [LB::server pool]] < 1} {
if {[active_members $backupPool] > 0} {
log local0.alert "Default pool [LB::server pool] as not active members, forwarding to $backupPool"
pool $backupPool
} else {
log local0.alert "Both default pool [LB::server pool] and $backupPool have no active members. Closing TCP connection"
TCP::close
}
}
}
Backup pool name is set to a variable at the start of the iRule and you can also change the final TCP::close if you wanted to do some other response like a sorry page etc.