Forum Discussion
DM_5174
Nimbostratus
Mar 10, 2010-- HELP PUTTING MULTIPLE IRULES TOGETHER
Hi All,
I was wondering if I can get the help of all the i-rule gurus here on this site.
We have 3 i-rules that i would like to put together as one, but for some reason
It is not working when I try to consolidate as one i--rule.
Here is the objective of the irule.
I-rule 1. This will send inbound connection to another server pool if the
URL ends with /APPxx
I-Rule 2. This will use the class data-group to only allow IP address that is defined for inbound connections to the WEBLOGIC pool during maintenance window, all other connections from external clients will need to get sent to the maintenance page "http://www.mainsite.com/maintenance/emergencydown.htm".
I-Rule 3. This is an additional monitor that will verify all members in the WEBLOGIC pool are up. If all the hosts are down, users regardless should get sent to the emergency downpage.
PROBLEM: When I consolidate the 3 i-rules together, I-Rule 1 does not seem to work. I connect, but when try to go to /APPxx, I get a error from the LTM that it can not find this directory. Please help, since rule 1 and 2 is most important and needs to work together.
I-RULE 1 Sends inbound connection to APACHE SVR POOL if URL ends with /APP.."
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/APP01*" -
"/APP02*" -
"/APP03*" -
"/APP004*" -
"/APP5*"
{
use pool APACHE-SERVER-POOL
}
default {
use pool WEBLOGIC-SERVER-POOL
}
}
I-RULE 2 Check if client IP is in the datagroup
if {[matchclass [IP::client_addr] equals $::ALLOW-DURING-MAINTENANCE]}{
pool WEBLOGIC-SERVER-POOL
} else {
HTTP::redirect "http://www.mainsite.com/maintenance/sched-maintenance.htm"
}
I-RULE 3 monitor members of pool and if down will send to emergency notification page, will also set the timer to return client to host URL
set stime 10
If the WEBLOGIC POOL is down, redirect to the emergency notification page
if { [active_members WEBLOGIC-SERVER-POOL] < 1 } {
HTTP::redirect "http://www.mainsite.com/maintenance/emergencydown.htm"
}
}
Thank you in advance!
- L4L7_53191
Nimbostratus
Can you post your consolidated rule? Also, you can eliminate 3 by defining a fallback host in a custom HTTP profile for your Weblogic VIP. - DM_5174
Nimbostratus
Here is the i-rule...For some reason, I get a 404 and it does not look like it is working.. - DM_5174
Nimbostratus
This is what I have so far. It seems to work half way, but for some reason when I add a "/APPxx" after going to - The_Bhattman
Nimbostratus
Hi AH,when HTTP_REQUEST { Check if client IP is in the datagroup if {[matchclass [IP::client_addr] equals $::ALLOW-DURING-MAINTENANCE]}{ pool WEBLOGIC-SERVER-POOL return } else { HTTP::redirect "http://www.mainsite.com/maintenance/sched-maintenance.htm" return } set stime 10 switch -glob [string tolower [HTTP::uri]] { "/app01*" - "/app02*" - "/app03*" - "/app004*" - "/app05*" { use pool APACHE-SERVER-POOL } } }
- DM_5174
Nimbostratus
Hi Bhattman, - hoolio
Cirrostratus
The logic in iRule 2 is going to always either send clients to the weblogic pool or redirect them. So if you have that first, you'll never allow anyone to get to the apache pool. - DM_5174
Nimbostratus
Hi Aaron, - The_Bhattman
Nimbostratus
Hi AH,when HTTP_REQUEST { Check if client IP is in the datagroup if {!([matchclass [IP::client_addr] equals $::ALLOW-DURING-MAINTENANCE])}{ HTTP::redirect "http://www.mainsite.com/maintenance/sched-maintenance.htm" } else { set stime 10 switch -glob [string tolower [HTTP::uri]] { "/app01*" - "/app02*" - "/app03*" - "/app004*" - "/app05*" { pool APACHE-SERVER-POOL } default { pool WEBLOGIC-POOL } } } }
- DM_5174
Nimbostratus
That did it...YOU ARE THE MAN BHATTMAN!
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