I don't think that there is a clever way of checking any of this - I would be logging onto the machines as the O/S user that runs the BG and checking that I could access the URL OK as first check - that would spot any "config/setup" errors, but if its a real intermittent error then I don't think theres anytrhing you can do from an application point of view, you'd need to be looking at your network really.
Is it possible that it works when running on BG but doesn't work when running on BG2? (the "config/setup" check might spot that)