Updated to include Availability from
Orion.ResponseTime, calculated Availability (based on minutes down from
Orion.NetObjectDowntime), and the number of 'Node rebooted' events from
There is plenty of details in the query about how the information was calculated. There's also a mention (commented out) on how to add filters for Node-based custom properties.
There will be a discrepancy between Availability and the Calculated Availability. This is based on the polling cycles, the pollers being used, and the way data is stored in the database. I (personally) prefer the Calculated Availability because it isn't limited to ICMP tests only.