Irule for Maintance Page

Dear i have below IRlue which for maintance page when pool be no service or montior be RED only

i whant also include if pool OFF (black)

when HTTP_REQUEST {

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

set sorrypage /Common/index

HTTP::respond 200 content [subst -nobackslashes [ifile get “$sorrypage”]] “Content-Type” “text/html; charset=utf-8”

} else {

}

}

change

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

to

if { [catch { eval [LB::select] }] } {

thanks samstep ..

when i change direct transfer to maintenance page even pool up or green

i hope find IRule for both case l red and off ant not available

thank you very mush again ,