Hi all,
I am creating this article here just to inform that I have created a SQL report to poll the Availability for the latest 7 days and filter the result.
The idea is to get the availability of all nodes on Orion with a less than 99% on the last seven days.
The query I used is:
select n.caption as NodeName, AVG(r.availability) as Availability
from [dbo].[ResponseTime_Detail] as r
inner join [dbo].[Nodes] as n ON r.nodeid=n.nodeid
where DateTime>DATEADD(day, -7, GETDATE() )
group by n.caption
having AVG(r.availability) < 99
On the query above you can see that I am doing an average on the availability for the nodes and I am only matching the last 7 days with "DATEADD(day, -7, GETDATE() )".
The last line is the way to filter the outcome of the query. In this case, I am getting only the information for when the availability is less than 99 %
Hope this helps someone! 