Hello,
I'm working on making our NPM alert emails more informative.
In the email I want to include Availability stats for 'Today', 'Yesterday', 'Last 7 Days' and so on, as the default Node page does in Orion.
I'm getting there but could use some help with the SQL syntax. In the email I have
Availability Last Month: ${SQL:Select AVG(ResponseTime.Availability) AS AVERAGE_of_Availability FROM Nodes INNER JOIN ResponseTime ON (Nodes.NodeID = ResponseTime.NodeID) WHERE ( DateTime BETWEEN DATEADD(MONTH, -2, GETDATE()) AND DATEADD(MONTH, -1, GETDATE()) ) AND ((Nodes.NodeID = ${NodeID}))}%
Which gives me
Average Availability Last Month: 100%
Which doesn't match the screenshot below. I've confirmed the SQL gives the same result using the Solarwinds Database Manager and it comes back with 100%
Does anyone have this SQL recipe already written out for the data in the screenshot below, or any SQL wizards who can help?
Thanks
~sm
