I use a construction like below to extract availability from the API (more fields and
filters in the real query) and I availability data, but this request does not take maintenance window into consideration, so I get a much lower availability than shown in GUI if the server has been down during maintenance.
Is there any way to get availability data from the API which will also handle the maintenance settings correct?
PS: from Solarwinds support they advised to make a scheduled report and then consume the data from the csv file - but the requirement is to handle this using the direct API to reduce complexity of the solution.
Query
SELECT N.Caption AS DeviceName,
AVG(R.Availability) AS MonthlyAvailability,
FROM Orion.ResponseTime R JOIN Orion.Nodes N ON R.NodeID = N.NodeID WHERE
R.ObservationTimestamp >= DATETRUNC('month', ADDMONTH(-1, GETDATE())) AND R.ObservationTimestamp < DATETRUNC('month', GETDATE()) GROUP BY N.Caption,
ORDER BY N.Caption