Forum Discussion

Godswill_Aliagh's avatar
Godswill_Aliagh
Icon for Nimbostratus rankNimbostratus
Oct 27, 2018

Looking i-rule help

I am looking for an i-rule that will display a static web page with message when all the member servers on a pool are down and offline

 

  • Depending on how fancy you want to get, you could host a separate HTML file, or simply inject the HTML content directly from the iRule.

    when HTTP_REQUEST {
        if { [active_members my_pool] < 1 } {
            HTTP::respond 200 content "..." "Connection" "close"
            return
        }
    }
    

    or

    when HTTP_REQUEST {
        if { [active_members my_pool] < 1 } {
            HTTP::respond 200 content [ifile get maintenance_page] "Connection" "close"
            return
        }
    }
    

    where maintenance_page is an iFile (https://devcentral.f5.com/wiki/iRules.iFile.ashx)