Forum Discussion
dennypayne
May 19, 2009Employee
Or use reverse monitors with "JRun closed connection" and "Server error" as receive strings.
Otherwise you're correct that you'd have to look in HTTP::payload, the main issue with that is you're going to have to do an HTTP::collect on every response, which could be fairly resource-intensive and/or add a lot of latency. Testing would reveal the extent of that. If you could limit the collect to something other than the full payload that would help (ie, if you know how many bytes along in the content either of those error messages would show up).
Something like this might work, I haven't tested:
when HTTP_RESPONSE {
HTTP::collect [HTTP::header Content-Length]
or use number of bytes rather than content-length
}
when HTTP_RESPONSE_DATA {
if { (string tolower [HTTP::payload] contains "jrun closed connection") || (string tolower [HTTP::payload] contains "server error") } {
LB::down
}
when LB_FAILED {
LB::reselect
}
The problem even with that is even if you mark the node down in a rule, the next successful health monitor will bring it back up, so you still need to have some sort of health monitor that's looking for this.