LB_FAILED is triggered on every request failure, so that would work to handle any single request. You get similar functionality using the Fallback Host on the HTTP profile. LTM can send a 302 redirect to the client without an iRule.
You could also use an iRule to send a response if all pool members are down. There are a few examples in the Codeshare for "maintenance" iRules (
Click here). Though these would need to be updated to use the class command (
Click here)instead of lindex.
Or you could use priority groups to send the request to a second set of servers if the first set is down.
Aaron