rschwarz79
Jun 13, 2024Nimbostratus
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é
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.