OK, I was playing around with the query and thought of an easier way to do this.
Go to alerts, under administrative alerts, there is an instance availability. Set that alert up for the instances you want to track.
Let that run and build up a history of checks about the instance.
You can then either check the availability history by checking on the results of that alert or query the data directly from the repo.
let me know if you want the latter and I can start looking into that.