One exception does not necessarily mean the agent is offline, it could be a network issue, a problem with DNS, or the host is just unresponsive at that moment.  I suggest we retry the request a couple of times (use an environment variable to set the max retries) if it fails to try and rule out most of these problems (except DNS, but we can't fix broken DNS of course).  The `requests` module can help here because it will do retries for you and give you a couple of different exceptions to work with.