Script to monitor state of connections to app.