Forum Discussion

Joe_Erchul_4263's avatar
Joe_Erchul_4263
Icon for Nimbostratus rankNimbostratus
May 11, 2011

LTM hosted maintenance page

I've researched the myriad of solutions for hosting a maintenance page on the LTM. For some reason, I'm not able to get my iRule to work. Here's the iRule:

 

 

when HTTP_REQUEST {

 

if { [active_members [LB::server pool]] < 1 } {

 

set sorry "

 

 

 

Page Unavailable

 

 

 

 

 

 

 

 

 

 

 

 

This page is currently unavailable due to scheduled maintenance. Expected outage is between 12:00am and 1:15am (US CDT). Please check back soon. We apologize for any inconvenience.

 

 

 

 

"}

 

{ HTTP::respond 200 content $::sorry }

 

}

 

 

 

 

Currently the virtual server is down on port 80, since all the nodes are failing. However, I'm unable to bring up this content via the iRule. I'm sure that it's something obvious, but I'm at a loss. Any thoughts?

 

 

 

LTM version 10.2.0, HF2.

 

 

 

Thanks in advance.

 

 

 

Joe

 

 

 

4 Replies

  • Try this

     

     

    when HTTP_REQUEST {

     

     

    if { [active_members [LB::server pool] ] == 0}

     

     

    instead of < 1

     

     

    Works for me

     

     

     

  • Thanks, Tory. I tried it, but no luck. I'm going to throw the iRule onto another VIP to see if it behaves any differently. I wouldn't expect it to, but you never know. :-)
  • If you are trying to get the LTM to generate the page, try this:

    
    when HTTP_REQUEST {
     Check and verify that there are Pool Members Available to server the request
    if { [active_members [LB::server pool]] < 1 } {
     If there are no members available, generate HTML Maintenance Page
    HTTP::respond 200 content "Site unavailable
    
    
    
    System Maintenance
    NOTICE: This site is under maintenance.
    
    "
    }
    }