Forum Discussion
irule maintanance page issue
Can anyone out there tell me what could be wrong with this code for an irule to reference HTML for a maintance splash page?
when HTTP_REQUEST { if { [active_members [LB::server pool]] == 0 } {
check if client access from internal subnet
if { [IP::addr [IP::client_addr]/8 equals 10.0.0.0] } {
pool alternate_pool
} else {
HTTP::respond 200 content { Sorry Page Sorry, The website is not available. Please try again later }
}
}
I am losing my mind over trying to figure it out. it is giving me a missing bracket error and when I input it into notepad++ it isn't showing any error. here is the errors it is giving me
01070151:3: Rule [/Common/test_maintanance] error: /Common/test_maintanance:1: error: [parse error: missing close-brace][{ if { [active_members [LB::server pool]] == 0 } { check if client access from internal subnet if { [IP::addr [IP::client_addr]/8 equals 10.0.0.0] } { pool alternate_pool } else { HTTP::respond 200 content { Sorry Page Sorry, The website is not available. Please try again later } } }] /Common/test_maintanance:2: error: [command is not valid in the current scope][if { [active_members [LB::server pool]] == 0 } { check if client access from internal subnet if { [IP::addr [IP::client_addr]/8 equals 10.0.0.0] } { pool alternate_pool } else { HTTP::respond 200 content { Sorry Page Sorry, The website is not available. Please try again later } }
Hi Jerm,
I've correctly formated the code and found a missing closing braked at the end...
when HTTP_REQUEST { if { [active_members [LB::server pool]] == 0 } { check if client access from internal subnet if { [IP::addr [IP::client_addr]/8 equals 10.0.0.0] } { pool alternate_pool } else { HTTP::respond 200 content { Sorry Page Sorry, The website is not available. Please try again later } noserver "Content-Type" "text/html" } } }
Cheers, Kai
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