Forum Discussion

rschwarz79's avatar
rschwarz79
Icon for Nimbostratus rankNimbostratus
Jun 13, 2024

LB_FAILED test event

Hello Folks,

 

Can someone tell/help me to test the LB_FAILED event? Background is I want to create a Sorry/Maintenance Page on my VS.

 

Simple iRule snippet:

when HTTP_REQUEST {
  
    if { [active_members [LB::server pool]] < 1 } {
               
        switch [HTTP::path] {
            "/MaintenancePage.png" { HTTP::respond 503 content [ifile get "MaintenancePage.png"] "Content-Type" "image/png" }
            default { HTTP::respond 503 content [ifile get "MaintenancePage.html"] "Content-Type" "text/html" noserver "Connection" "close" }
        }
        
    }
        
}



when LB_FAILED {

    switch [HTTP::path] {
        "/MaintencePage.png" { HTTP::respond 504 content [ifile get "MaintencePage.png"] "Content-Type" "image/png" }
        default { HTTP::respond 504 content [ifile get "LBFailedPage.html"] "Content-Type" "text/html" }
    }   


}

 

I am not sure if the same syntax from HTTP_REQUEST is also working in LB_FAILED event. Is there any simple way to test this event or isn't possible in a working environment? 

 

Thanks & Best regards

René

2 Replies

  • set the pool member to wrong/invalid tcp port but make the health monitor to be success, e.g. using ping, tcp to valid port or etc.

    if it is production system, create test pool and irules/traffic policy for the vserver to direct your test traffic to the test pool.

  • off course this can't be tried in prod environment. but in non-prod environment you can modify the health monitor to any other which pool members won't be able to respond or modify the pool member port to any other random port and see if that event triggers.