Hi Pierrejn,
the iRule below is a combination of your two dedicated iRules...
when HTTP_REQUEST {
set VSPool [class match -value [string tolower [HTTP::host]] equals _http_pools]
if { $VSPool ne "" } then {
if { [active_members $VSPool] > 0 } then {
pool $VSPool
} else {
log local0. "Client [IP::client_addr] requested [HTTP::uri] no active nodes available..."
HTTP::respond 200 content "
We'll be back!
IMPORTANT MESSAGE
Please be advised that we are performing a scheduled maintenance on the site you are trying to access. All site access will be unavailable during this maintenance. Service is expected to resume February 4 at 5 a.m. CT
"
}
} else {
Unknown HOST-Name requested...
}
}
Note: Updated the post to correct a formating glitch...
Cheers, Kai