Forum Discussion
diana_24252
Nimbostratus
Apr 22, 2010iRule with two IF statements is not working correctly
I have this iRule below and it does a good job on forwarding to pools POOL_PUB_MOSS and MyCampus_Pool, but not to the Offline_Pool when all servers are down or disabled. What do I need to change? ...
hoolio
Cirrostratus
Apr 22, 2010The iRule looks okay. Can you try testing again with debug logging and then check /var/log/ltm for the output?
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::host][HTTP::uri]"
if { [matchclass [HTTP::uri] starts_with $PRODMOSS] } {
log local0. "[IP::client_addr]:[TCP::client_port]: Matched MOSS URI check"
if {[active_members POOL_PUB_MOSS] > 0 } {
log local0. "[IP::client_addr]:[TCP::client_port]: MOSS pool up, using it"
pool POOL_PUB_MOSS
} else {
log local0. "[IP::client_addr]:[TCP::client_port]: MOSS pool down, using offline pool"
pool Offline_Pool
}
} else {
log local0. "[IP::client_addr]:[TCP::client_port]: No match for MOSS URI check"
if {[active_members MyCampus_Pool] > 0 } {
pool MyCampus_Pool
log local0. "[IP::client_addr]:[TCP::client_port]: MyCampus pool up, using it"
} else {
log local0. "[IP::client_addr]:[TCP::client_port]: MyCampus pool down, using offline pool"
pool Offline_Pool
}
}
}
when SERVER_CONNECTED {
log local0. "[IP::client_addr]:[TCP::client_port]: Connected to [LB::server]"
}
Aaron
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
