Forum Discussion
iRule for App Offline
There is a way to do it but you need to make sure you follow the config as follow The pool name have to be in lower case and equal to the domain name. This is because we are getting the Header from the request and change it to lower case In this Irule, I am adding the word pl_ but you can remove it Example Http or https://abc.123.com the pool name have to be abc.123.com
when HTTP_REQUEST {
set the host name and url to lower caseset Vuri [ string tolower [HTTP::uri]] set Vheader [string tolower [HTTP::host]]
set the Poolname variable.set Poolname "$Vheader"
set the default site name variableset SiteName "XXXX.MAINTENANCEPAGE.org"
set Irulename "Irule_$SiteName" set SiteRedirect "https://$SiteName"
Obtain active poolmembers count and listset Poolmember [active_members $Poolname ] set Poolmemberlist [ active_members -list $Poolname]
if {$Poolmember < 1} then {
log local0.alert "ALERT-TEAM Pool $Poolname is down. This mean $SiteName website is down. IRULE=$Irulename";
HTTP::redirect "http://www.YOURPAGE-OFFLINE.COM"
}
pool $Poolname
}
Let me know if this works for you
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