Forum Discussion

Anthony_Pineda's avatar
Anthony_Pineda
Icon for Nimbostratus rankNimbostratus
Mar 24, 2015

IRule for redirection after several hours of downtime

One of my clients has a request to redirect to a page after server pool has been down for two hours. Anyone have any ideas how I can get this going? Thanks!

 

6 Replies

  • What will the VIP be doing for the first two hours if the pool is down? If there are no members available they will just get a reset.
  • Sorry but forgot to mention that they use custom http profile with fallback host to redirect traffic to another web page on another server if pool goes down. In addition to this they want to move or redirect again to a different website if they cannot fix their issue in two hours. I already said why not just point to the other site right away but these application folksmay be hearing voices that dictate them to do this instead.

     

  • you could try setting a timer using table in the LB_FAILED. You will have to remove the table entry if it exists in a LB_SELECTED event.

    when LB_FAILED {
        if { [active_members http_pool] = 0 } {
            if { table lookup -notouch "[virtual name]_fallback" > 0 } {
                if { expr [clock seconds] - [table lookup -notouch "[virtual name]_fallback"] >= 7200} {
                    HTTP::fallback 
                }
            }
            else {
                table add "[virtual name]_fallback" [clock seconds] lifetime -1               
            }
        }
    }
    
    • jgranieri_42214's avatar
      jgranieri_42214
      Icon for Nimbostratus rankNimbostratus
      Brad could you use an irule with the "after" command? I know this queues up connections and may not be optimal bt it wold achieve the same result. with the above code snippet would that imply you need to have a LB_selected event as well since your using tables?
  • you could try setting a timer using table in the LB_FAILED. You will have to remove the table entry if it exists in a LB_SELECTED event.

    when LB_FAILED {
        if { [active_members http_pool] = 0 } {
            if { table lookup -notouch "[virtual name]_fallback" > 0 } {
                if { expr [clock seconds] - [table lookup -notouch "[virtual name]_fallback"] >= 7200} {
                    HTTP::fallback 
                }
            }
            else {
                table add "[virtual name]_fallback" [clock seconds] lifetime -1               
            }
        }
    }
    
    • jgranieri_42214's avatar
      jgranieri_42214
      Icon for Nimbostratus rankNimbostratus
      Brad could you use an irule with the "after" command? I know this queues up connections and may not be optimal bt it wold achieve the same result. with the above code snippet would that imply you need to have a LB_selected event as well since your using tables?